当前位置: 代码迷 >> Sql Server >> 使用SQL参数进行insert操作一直报错解决方法
  详细解决方案

使用SQL参数进行insert操作一直报错解决方法

热度:27   发布时间:2016-04-27 14:31:51.0
使用SQL参数进行insert操作一直报错
用这一句插入数据时发现一直报错说是“=”号附近有错误 
SQLHelper.ExecuteNonQuery("insert into T_Book (Name,Type,Price) values([email protected],[email protected],[email protected])", new SqlParameter("name", bookName), new SqlParameter("type", BookType), new SqlParameter("price", bookPrice));

执行这一句却可以,我是哪里写错了,一直没发现
SQLHelper.ExecuteNonQuery("update T_Admin set ErrorTimes=0 where [email protected]", new SqlParameter("name", name));

------解决方案--------------------
"insert into T_Book (Name,Type,Price) values(@name,@type,@price)"
------解决方案--------------------
SQL code
insert into T_Book (Name,Type,Price) values(@name,@type,@price)
  相关解决方案