'ProductId' 附近有语法错误。
说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。 异常详细信息: System.Data.SqlClient.SqlException: 'ProductId' 附近有语法错误。源错误: 执行当前 Web 请求期间生成了未处理的异常。可以使用下面的异常堆栈跟踪信息确定有关异常原因和发生位置的信息。 堆栈跟踪:
[SqlException (0x80131904): 'ProductId' 附近有语法错误。]
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.SqlDataReader.ConsumeMetaData() +33
System.Data.SqlClient.SqlDataReader.get_MetaData() +83
System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) +297
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.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) +32
System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method) +141
System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior) +12
System.Data.Common.DbCommand.ExecuteReader(CommandBehavior behavior) +10
Microsoft.Practices.EnterpriseLibrary.Data.Database.DoExecuteReader(DbCommand command, CommandBehavior cmdBehavior) +181
Microsoft.Practices.EnterpriseLibrary.Data.Database.ExecuteReader(DbCommand command) +130
Hidistro.SaleSystem.DistributionData.ProductData.GetCounDownProducList(Int32 maxnum) in F:\edit\hidistro20\Hidistro.SaleSystem.DistributionData\ProductData.cs:108
Hidistro.SaleSystem.Catalog.ProductBrowser.GetCounDownProducList(Int32 maxnum) in F:\edit\hidistro20\Hidistro.SaleSystem.Catalog\ProductBrowser.cs:34
Hidistro.UI.SaleSystem.Tags.Common_GoodsList_LatestCountDownBuy.AttachChildControls() in F:\edit\hidistro20\Hidistro.UI.SaleSystem.Tags\Common_GoodsList_LatestCountDownBuy.cs:16
Hidistro.UI.Common.Controls.AscxTemplatedWebControl.CreateChildControls() in F:\edit\hidistro20\Hidistro.UI.Common.Controls\AscxTemplatedWebControl.cs:24
System.Web.UI.Control.EnsureChildControls() +87
System.Web.UI.Control.PreRenderRecursiveInternal() +44
System.Web.UI.Control.PreRenderRecursiveInternal() +171
System.Web.UI.Control.PreRenderRecursiveInternal() +171
System.Web.UI.Control.PreRenderRecursiveInternal() +171
System.Web.UI.Control.PreRenderRecursiveInternal() +171
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +842
--------------------------------------------------------------------------------
说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。 异常详细信息: System.Data.SqlClient.SqlException: 'ProductId' 附近有语法错误。源错误: 执行当前 Web 请求期间生成了未处理的异常。可以使用下面的异常堆栈跟踪信息确定有关异常原因和发生位置的信息。 堆栈跟踪:
[SqlException (0x80131904): 'ProductId' 附近有语法错误。]
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.SqlDataReader.ConsumeMetaData() +33
System.Data.SqlClient.SqlDataReader.get_MetaData() +83
System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) +297
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.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) +32
System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method) +141
System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior) +12
System.Data.Common.DbCommand.ExecuteReader(CommandBehavior behavior) +10
Microsoft.Practices.EnterpriseLibrary.Data.Database.DoExecuteReader(DbCommand command, CommandBehavior cmdBehavior) +181
Microsoft.Practices.EnterpriseLibrary.Data.Database.ExecuteReader(DbCommand command) +130
Hidistro.SaleSystem.DistributionData.ProductData.GetCounDownProducList(Int32 maxnum) in F:\edit\hidistro20\Hidistro.SaleSystem.DistributionData\ProductData.cs:108
Hidistro.SaleSystem.Catalog.ProductBrowser.GetCounDownProducList(Int32 maxnum) in F:\edit\hidistro20\Hidistro.SaleSystem.Catalog\ProductBrowser.cs:34
Hidistro.UI.SaleSystem.Tags.Common_GoodsList_LatestCountDownBuy.AttachChildControls() in F:\edit\hidistro20\Hidistro.UI.SaleSystem.Tags\Common_GoodsList_LatestCountDownBuy.cs:16
Hidistro.UI.Common.Controls.AscxTemplatedWebControl.CreateChildControls() in F:\edit\hidistro20\Hidistro.UI.Common.Controls\AscxTemplatedWebControl.cs:24
System.Web.UI.Control.EnsureChildControls() +87
System.Web.UI.Control.PreRenderRecursiveInternal() +44
System.Web.UI.Control.PreRenderRecursiveInternal() +171
System.Web.UI.Control.PreRenderRecursiveInternal() +171
System.Web.UI.Control.PreRenderRecursiveInternal() +171
System.Web.UI.Control.PreRenderRecursiveInternal() +171
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +842
--------------------------------------------------------------------------------
解决方案 »
- 如何获取动态控件里的值
- 存储过程 运算不能以ntext数据类型作为参数
- 比较简单的问题,我不会,谁能帮帮我
- 高手们,帮解释解释递归吧,最好带个简单的小例子,无意间想起的谢谢各位了
- 微软Studio .NET 2005 中文版究竟什么时候出啊?
- 高分求答案!
- 调用WebService为什么总是出现"State overflow at line 0"的错误提示
- 请各位大哥大姐帮帮忙,用ODBC连接数据库为什么连不上?急!!!
- 有关TemplateColumn及数据类型转换
- 从工具箱中放一个DataGrid入Web Forms中,预览时为什么显示不出来?
- JS代码怎么实现点button按钮新增个table
- 整个网页用div遮住,鼠标点击上面的div怎么获得鼠标下面的HTML元素
告诉你了,错误就在 'ProductId' 附近。
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.SqlDataReader.ConsumeMetaData() +33
System.Data.SqlClient.SqlDataReader.get_MetaData() +83
System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) +297
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.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) +32
System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method) +141
System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior) +12
System.Data.Common.DbCommand.ExecuteReader(CommandBehavior behavior) +10
Microsoft.Practices.EnterpriseLibrary.Data.Database.DoExecuteReader(DbCommand command, CommandBehavior cmdBehavior) +181
Microsoft.Practices.EnterpriseLibrary.Data.Database.ExecuteReader(DbCommand command) +130
Hidistro.SaleSystem.DistributionData.ProductData.GetCounDownProducList(Int32 maxnum) in F:\edit\hidistro20\Hidistro.SaleSystem.DistributionData\ProductData.cs:108
Hidistro.SaleSystem.Catalog.ProductBrowser.GetCounDownProducList(Int32 maxnum) in F:\edit\hidistro20\Hidistro.SaleSystem.Catalog\ProductBrowser.cs:34
Hidistro.UI.SaleSystem.Tags.Common_GoodsList_LatestCountDownBuy.AttachChildControls() in F:\edit\hidistro20\Hidistro.UI.SaleSystem.Tags\Common_GoodsList_LatestCountDownBuy.cs:16
Hidistro.UI.Common.Controls.AscxTemplatedWebControl.CreateChildControls() in F:\edit\hidistro20\Hidistro.UI.Common.Controls\AscxTemplatedWebControl.cs:24
System.Web.UI.Control.EnsureChildControls() +87
System.Web.UI.Control.PreRenderRecursiveInternal() +44
System.Web.UI.Control.PreRenderRecursiveInternal() +171
System.Web.UI.Control.PreRenderRecursiveInternal() +171
System.Web.UI.Control.PreRenderRecursiveInternal() +171
System.Web.UI.Control.PreRenderRecursiveInternal() +171
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +842
猜吧:
1.productId 旁边没有逗号
2.productId 旁边字段没有空格
3.productId 旁边有无效字符、符号
4.productId 旁边有sql语句拼写错误
1,防止语法出错,如德语,西班牙语等带逗号的常会出现SQL错误。
2.安全方面大打折扣,如防止注入脚本等。
3.不易维护,改别人的BUG时找起来很痛苦啊。