每次运行的时候就会有“异常详细信息: System.Data.SqlClient.SqlException: 第 1 行: '=' 附近有语法错误 5
[SqlException(0x80131904):第1行:'='附近有语法错误。]System.Data.SqlClient.SqlConnection.OnError...
[SqlException (0x80131904): 第 1 行: '=' 附近有语法错误。]
System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) +95
System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +82
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +346
System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +3244
System.Data.SqlClient.SqlDataReader.ConsumeMetaData() +52
System.Data.SqlClient.SqlDataReader.get_MetaData() +130
System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) +371
System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) +1121
System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) +334
System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) +45
System.Data.SqlClient.SqlCommand.ExecuteScalar() +161
DB_con.executeGetReturn(String strsql) in d:\鸽子\BYSJGLXT\App_Code\DB_con.cs:50
shouye.CheckStudentID() in d:\鸽子\BYSJGLXT\TitleChoose.aspx.cs:148
shouye.checkStudentNumber() in d:\鸽子\BYSJGLXT\TitleChoose.aspx.cs:115
shouye.GridView1_SelectedIndexChanged(Object sender, EventArgs e) in d:\鸽子\BYSJGLXT\TitleChoose.aspx.cs:89
System.Web.UI.WebControls.GridView.OnSelectedIndexChanged(EventArgs e) +96
System.Web.UI.WebControls.GridView.HandleSelect(Int32 rowIndex) +127
System.Web.UI.WebControls.GridView.HandleEvent(EventArgs e, Boolean causesValidation, String validationGroup) +246
System.Web.UI.WebControls.GridView.RaisePostBackEvent(String eventArgument) +214
System.Web.UI.WebControls.GridView.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +31
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +32
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +244
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3838
运行到这里就会出错:string result = cmd.ExecuteScalar().ToString();
这个问题要怎么解决呀? 展开
System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) +95
System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +82
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +346
System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +3244
System.Data.SqlClient.SqlDataReader.ConsumeMetaData() +52
System.Data.SqlClient.SqlDataReader.get_MetaData() +130
System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) +371
System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) +1121
System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) +334
System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) +45
System.Data.SqlClient.SqlCommand.ExecuteScalar() +161
DB_con.executeGetReturn(String strsql) in d:\鸽子\BYSJGLXT\App_Code\DB_con.cs:50
shouye.CheckStudentID() in d:\鸽子\BYSJGLXT\TitleChoose.aspx.cs:148
shouye.checkStudentNumber() in d:\鸽子\BYSJGLXT\TitleChoose.aspx.cs:115
shouye.GridView1_SelectedIndexChanged(Object sender, EventArgs e) in d:\鸽子\BYSJGLXT\TitleChoose.aspx.cs:89
System.Web.UI.WebControls.GridView.OnSelectedIndexChanged(EventArgs e) +96
System.Web.UI.WebControls.GridView.HandleSelect(Int32 rowIndex) +127
System.Web.UI.WebControls.GridView.HandleEvent(EventArgs e, Boolean causesValidation, String validationGroup) +246
System.Web.UI.WebControls.GridView.RaisePostBackEvent(String eventArgument) +214
System.Web.UI.WebControls.GridView.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +31
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +32
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +244
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3838
运行到这里就会出错:string result = cmd.ExecuteScalar().ToString();
这个问题要怎么解决呀? 展开
3个回答
展开全部
第 1 行: '=' 附近有语法错误。
SQL问题,拼接的SQL语句无法执行。
尝试加断点,取出拼接完的SQL,放到查询分析器里看看哪里出现的问题
SQL问题,拼接的SQL语句无法执行。
尝试加断点,取出拼接完的SQL,放到查询分析器里看看哪里出现的问题
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
这是java么。。。这明明是c#
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
额
C# 来的
C# 来的
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询