开发者社区> 问答> 正文

从数据类型 varchar 转换为 numeric 时出错,什么原因?? 400 报错

从数据类型 varchar 转换为 numeric 时出错,什么原因?? 400 报错 插入数据时,我使用一个存储过程,返回的时候出现“从数据类型 varchar 转换为 numeric 时出错。”这样的错误。帮忙解决一下。

展开
收起
爱吃鱼的程序员 2020-06-02 11:48:30 549 0
1 条回答
写回答
取消 提交回答
  • https://developer.aliyun.com/profile/5yerqm5bn5yqg?spm=a2c6h.12873639.0.0.6eae304abcjaIB

    你是怎么转的?

    ######

    本身没有转换。

     

     DbCommand _dbcomm = DB.GetStoredProcCommand("p_au_I_biddinginfo");
                DB.AddInParameter(_dbcomm, "@ID", DbType.Int32, _biddinginfo.ID);
                DB.AddInParameter(_dbcomm, "@Address", DbType.String, _biddinginfo.Address);
                DB.AddInParameter(_dbcomm, "@Area", DbType.Decimal, _biddinginfo.Area);
                DB.AddInParameter(_dbcomm, "@Areaid", DbType.Int32, _biddinginfo.Areaid);
                DB.AddInParameter(_dbcomm, "@Border", DbType.Int32, _biddinginfo.Border);
                DB.AddInParameter(_dbcomm, "@Cellid", DbType.Int32, _biddinginfo.Cellid);
                DB.AddInParameter(_dbcomm, "@Cellname", DbType.String, _biddinginfo.Cellname);
                DB.AddInParameter(_dbcomm, "@Checkstate", DbType.Boolean, _biddinginfo.Checkstate);
                DB.AddInParameter(_dbcomm, "@Cmessage", DbType.String, _biddinginfo.Cmessage);
                DB.AddInParameter(_dbcomm, "@Cqq", DbType.String, _biddinginfo.Cqq);
                DB.AddInParameter(_dbcomm, "@Cuser", DbType.String, _biddinginfo.Cuser);
                DB.AddInParameter(_dbcomm, "@Ddate", DbType.DateTime, _biddinginfo.Ddate);
                DB.AddInParameter(_dbcomm, "@description", DbType.String, _biddinginfo.description);
                DB.AddInParameter(_dbcomm, "@Edatetime", DbType.DateTime, _biddinginfo.Edatetime);
                DB.AddInParameter(_dbcomm, "@Email", DbType.String, _biddinginfo.Email);
                DB.AddInParameter(_dbcomm, "@Marker", DbType.String, _biddinginfo.Marker);
                DB.AddInParameter(_dbcomm, "@Mobile", DbType.String, _biddinginfo.Mobile);
                DB.AddInParameter(_dbcomm, "@Pdate", DbType.DateTime, _biddinginfo.Pdate);
                DB.AddInParameter(_dbcomm, "@Pid", DbType.Int32, _biddinginfo.Pid);
                DB.AddInParameter(_dbcomm, "@Pirce", DbType.Decimal, _biddinginfo.Pirce);
                DB.AddInParameter(_dbcomm, "@S", DbType.Int32, _biddinginfo.S);
                DB.AddInParameter(_dbcomm, "@State", DbType.Boolean, _biddinginfo.State);
                DB.AddInParameter(_dbcomm, "@Styleid", DbType.Int32, _biddinginfo.Styleid);
                DB.AddInParameter(_dbcomm, "@T", DbType.Int32, _biddinginfo.T);
                DB.AddInParameter(_dbcomm, "@Type", DbType.Int32, _biddinginfo.Type);
                DB.AddInParameter(_dbcomm, "@W", DbType.Int32, _biddinginfo.W);
               // DB.AddInParameter(_dbcomm, "@NumberID", DbType.String, DateTime.Now.ToString("yyyyMMddHHmmssffff"));

    ######肯定要做转换的啊,varchar 要先转成 number######我不明白你的意思。我是插入操作。什么地方需要转换?
    2020-06-02 11:48:46
    赞同 展开评论 打赏
问答分类:
问答地址:
问答排行榜
最热
最新

相关电子书

更多
低代码开发师(初级)实战教程 立即下载
冬季实战营第三期:MySQL数据库进阶实战 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载