日期:2014-05-18  浏览次数:20621 次

使用SQL参数进行insert操作一直报错
用这一句插入数据时发现一直报错说是“=”号附近有错误 
SQLHelper.ExecuteNonQuery("insert into T_Book (Name,Type,Price) values(Name=@name,Type=@type,Price=@price)", new SqlParameter("name", bookName), new SqlParameter("type", BookType), new SqlParameter("price", bookPrice));

执行这一句却可以,我是哪里写错了,一直没发现
SQLHelper.ExecuteNonQuery("update T_Admin set ErrorTimes=0 where Name=@name", 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)