当我使用sqldata源更新gridview值时,出现以下错误 [英] when i am updating the gridview values by using sqldata source i am getting the following error

查看:64
本文介绍了当我使用sqldata源更新gridview值时,出现以下错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

''nvarchar''.
附近的语法不正确 必须声明标量变量"@firno".

Incorrect syntax near ''nvarchar''.
Must declare the scalar variable "@firno".

UpdateCommand="UPDATE [fir] SET [dist] = @dist, [dist1] = @dist1, [name] = @name, [fir contents] = @fir_contents, [type] = @type, [idno] = @idno WHERE [firno] = @firno">




在这里,我正在使用sql数据源将数据绑定到gridview.




here i am using sql data source to bind data to gridview.

推荐答案

您可能会忘记声明和设置吗?

Could be you forgot to declare and set

Declare @firno int
select @firno = 1





你忘记了



or

you forgot

SqlCommand cmd = new SqlCommand(SQL, conn);
cmd.Parameters.AddWithValue("@firno", intVal);


查看这些链接,您可能会有所了解
http://forums.asp.net/t/1201543.aspx/1 [ ^ ]

http://stackoverflow.com/questions/1269828/incorrect-语法-near-nvarchar-in-update-asp-net-gridview [
see these links you may get some idea
http://forums.asp.net/t/1201543.aspx/1[^]

http://stackoverflow.com/questions/1269828/incorrect-syntax-near-nvarchar-in-update-asp-net-gridview[^]


这篇关于当我使用sqldata源更新gridview值时,出现以下错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆