参数化查询 '(@product_id int,@product_type int,@product_p' 需要参数 @product_price,但未提供该参

xiaolinxi 2010-11-18 03:36:12
参数化查询 '(@product_id int,@product_type int,@product_count int,@product_p' 需要参数 @product_price,但未提供该参数。
说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。

异常详细信息: System.Data.SqlClient.SqlException: 参数化查询 '(@product_id int,@product_type int,@product_count int,@product_p' 需要参数 @product_price,但未提供该参数。

源错误:


行 164: catch (Exception)
行 165: {
行 166: throw;
行 167: }
行 168: finally


源文件: F:\sx\cs\DAl\example\ProductDAL.cs 行: 166

堆栈跟踪:


[SqlException (0x80131904): 参数化查询 '(@product_id int,@product_type int,@product_count int,@product_p' 需要参数 @product_price,但未提供该参数。]
System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) +1950890
System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +4846875
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +194
System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +2392
System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) +204
System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) +954
System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) +162
System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe) +175
System.Data.SqlClient.SqlCommand.ExecuteNonQuery() +137
DAL.example.ProductDAL.UpdateProduct(Product product) in F:\sx\cs\DAl\example\ProductDAL.cs:166
example_ProductUpdate.btUpdate_Click(Object sender, EventArgs e) in f:\sx\cs\web\example\ProductUpdate.aspx.cs:53
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +111
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +110
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565




--------------------------------------------------------------------------------
版本信息: Microsoft .NET Framework 版本:2.0.50727.3082; ASP.NET 版本:2.0.50727.3082
...全文
345 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
无赖天涯 2012-10-24
  • 打赏
  • 举报
回复
怎样解决这个问题
g_lbz 2010-11-18
  • 打赏
  • 举报
回复
存储过程或者查询语句中未传递参数@product_price
烈火蜓蜻 2010-11-18
  • 打赏
  • 举报
回复
没有提供参数 @product_price 的值
「已注销」 2010-11-18
  • 打赏
  • 举报
回复
参数 @product_price 没有传入值

111,129

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Creator Browser
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧