当前位置: 代码迷 >> ASP.NET >> 转化为money数据类型解决方法
  详细解决方案

转化为money数据类型解决方法

热度:2548   发布时间:2013-02-26 00:00:00.0
转化为money数据类型
我用textbox来输入数据,然后在sql语句中使用这些值来插入新的行数据,但是有意个列是money类型的,我插入时,总体是错误 "允许从数据类型       varchar       到数据类型       money       的隐性转换(表       'pdssme.pds.jobseeker ',列       'money ')。请使用       CONVERT       函数来运行此查询。       "          
请问怎么转化?

------解决方案--------------------------------------------------------
SqlCommand mycommand =
new SqlCommand( "insert into Product(...) values ( 'Category_ID ', ' "+Product_name+ " ', ' "+description+ " ', ' "+ImageUrl+ " ', "+unitcost.ToString()+ ", ' "+Tel+ " ', ' "+HttpContext.Current.User.Identity.Name+ " ', ' "+DateTime.Now.ToString()+ " ') ",myconnect);

试试。
------解决方案--------------------------------------------------------
sql就是string.
  相关解决方案