C# 列名或所提供值的数目与表定义不匹配
异常详细信息:System.Data.SqlClient.SqlException:列名或所提供值的数目与表定义不匹配。源错误:行104:SqlConnectioncon...
异常详细信息: System.Data.SqlClient.SqlException: 列名或所提供值的数目与表定义不匹配。
源错误:
行 104: SqlConnection conn = getConn();
行 105: SqlCommand com = new SqlCommand(insertCmdString, conn);
行 106: int count = com.ExecuteNonQuery();
行 107: return testCount(count);
行 108: }
源文件: d:\首报管理系统\项目代码\首报管理系统\App_Code\DAL\SqlHelper.cs 行: 106
堆栈跟踪:
[SqlException (0x80131904): 列名或所提供值的数目与表定义不匹配。]
System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) +2062078
System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +5050204
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning() +234
System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +2275
System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async) +228
System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe) +326
System.Data.SqlClient.SqlCommand.ExecuteNonQuery() +137
DAL.SqlHelper.insertData(String insertCmdString) in d:\首报管理系统\项目代码\首报管理系统\App_Code\DAL\SqlHelper.cs:106
DAL.FindBookDAL.AddBook(Book book) in d:\首报管理系统\项目代码\首报管理系统\App_Code\DAL\FindBookDAL.cs:46
BLL.FindBookBLL.AddBook(Book book) in d:\首报管理系统\项目代码\首报管理系统\App_Code\BLL\FindBookBLL.cs:28
addBook.btnAdd_Click(Object sender, EventArgs e) in d:\首报管理系统\项目代码\首报管理系统\addBook.aspx.cs:329
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +118
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +112
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) +5563 展开
源错误:
行 104: SqlConnection conn = getConn();
行 105: SqlCommand com = new SqlCommand(insertCmdString, conn);
行 106: int count = com.ExecuteNonQuery();
行 107: return testCount(count);
行 108: }
源文件: d:\首报管理系统\项目代码\首报管理系统\App_Code\DAL\SqlHelper.cs 行: 106
堆栈跟踪:
[SqlException (0x80131904): 列名或所提供值的数目与表定义不匹配。]
System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) +2062078
System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +5050204
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning() +234
System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +2275
System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async) +228
System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe) +326
System.Data.SqlClient.SqlCommand.ExecuteNonQuery() +137
DAL.SqlHelper.insertData(String insertCmdString) in d:\首报管理系统\项目代码\首报管理系统\App_Code\DAL\SqlHelper.cs:106
DAL.FindBookDAL.AddBook(Book book) in d:\首报管理系统\项目代码\首报管理系统\App_Code\DAL\FindBookDAL.cs:46
BLL.FindBookBLL.AddBook(Book book) in d:\首报管理系统\项目代码\首报管理系统\App_Code\BLL\FindBookBLL.cs:28
addBook.btnAdd_Click(Object sender, EventArgs e) in d:\首报管理系统\项目代码\首报管理系统\addBook.aspx.cs:329
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +118
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +112
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) +5563 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询