System.Data.SqlClient.SqlException: 第 1 行: ',' 附近有语法错误 10
源错误:行85:System.Data.SqlClient.SqlCommandcomm=newSqlCommand(sql,conn);行86:conn.Open();...
源错误:
行 85: System.Data.SqlClient.SqlCommand comm = new SqlCommand(sql, conn);
行 86: conn.Open();
行 87: comm.ExecuteNonQuery();
行 88: conn.Close();
行 89: return null;
源文件: j:\zhongbang\zhongbang1\0911\App_Code\db.cs 行: 87
堆栈跟踪:
[SqlException (0x80131904): 第 1 行: ',' 附近有语法错误。]
System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) +1949258
System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +4845243
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.RunExecuteNonQueryTds(String methodName, Boolean async) +192
System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe) +317
System.Data.SqlClient.SqlCommand.ExecuteNonQuery() +137
db.exec(String sql) in j:\zhongbang\zhongbang1\0911\App_Code\db.cs:87
administrator_unit_unit_modi.addUnit_Click(Object sender, EventArgs e) in j:\zhongbang\zhongbang1\0911\administrator\unit\unit_modi.aspx.cs:185
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 展开
行 85: System.Data.SqlClient.SqlCommand comm = new SqlCommand(sql, conn);
行 86: conn.Open();
行 87: comm.ExecuteNonQuery();
行 88: conn.Close();
行 89: return null;
源文件: j:\zhongbang\zhongbang1\0911\App_Code\db.cs 行: 87
堆栈跟踪:
[SqlException (0x80131904): 第 1 行: ',' 附近有语法错误。]
System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) +1949258
System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +4845243
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.RunExecuteNonQueryTds(String methodName, Boolean async) +192
System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe) +317
System.Data.SqlClient.SqlCommand.ExecuteNonQuery() +137
db.exec(String sql) in j:\zhongbang\zhongbang1\0911\App_Code\db.cs:87
administrator_unit_unit_modi.addUnit_Click(Object sender, EventArgs e) in j:\zhongbang\zhongbang1\0911\administrator\unit\unit_modi.aspx.cs:185
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 展开
展开全部
System.Data.SqlClient.SqlException: 第 1 行: ',' 附近有语法错误
应该是 你的SQL语句中有多余的这种符号!比如你的插入中多了一个'.'这个符号自己查下SQL语句!
应该是 你的SQL语句中有多余的这种符号!比如你的插入中多了一个'.'这个符号自己查下SQL语句!
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询