sql update语句参数使用个数问题(高手帮忙啊)
sql语句如下"update news set name=?,id=?,aa=?..... where id=1"
参数赋值语句如下
olecmd.Parameters.Add("@name",OleDbType.VarChar,50);
olecmd.Parameters[("@name"].Value=str;
当参数得个数比较少时可以执行,当参数得个数大于7的时候不能执行啊,
出错提示:
[OleDbException (0x80040e21): 多步 OLE DB 操作产生错误。如果可能,请检查每个 OLE DB 状态值。没有工作被完成。]
[InvalidOperationException: 命令参数[11] '@name' 无效。
]
System.Data.OleDb.OleDbCommand.ExecuteCommandTextErrorHandling(Int32 hr) +41
System.Data.OleDb.OleDbCommand.ExecuteCommandTextForMultpleResults(tagDBPARAMS dbParams, Object& executeResult) +99
System.Data.OleDb.OleDbCommand.ExecuteCommandText(Object& executeResult) +62
System.Data.OleDb.OleDbCommand.ExecuteCommand(CommandBehavior behavior, Object& executeResult) +65
System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior behavior, String method) +112
System.Data.OleDb.OleDbCommand.ExecuteNonQuery()
lyweb.sqlop.excsql(OleDbCommand olecmd) in d:\inetpub\wwwroot\lyweb\sqlop.cs:385
lyweb.news_edt.Button1_Click(Object sender, EventArgs e) in d:\inetpub\wwwroot\lyweb\news_edt.aspx.cs:213
System.Web.UI.WebControls.Button.OnClick(EventArgs e)
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
System.Web.UI.Page.ProcessRequestMain() +1277
有解决的吗,参数大于7个,我现在的参数是11个,还可能再多?高手帮忙啊,up者有分,解决就给分!