System.Data.SqlClient.SqlException: 对象名 'newsData' 无效
对象名 'newsData ' 无效。
说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。
异常详细信息: System.Data.SqlClient.SqlException: 对象名 'newsData ' 无效。
源错误:
行 95: cmd.CommandText = strSQL.ToString();
行 96: //执行添加的SqlCommand命令
行 97: int val = cmd.ExecuteNonQuery(); < <=这行问题
行 98: //清空SqlCommand命令中的参数
行 99: cmd.Parameters.Clear();
源文件: c:\Documents and Settings\Administrator\桌面\YWcar\App_Code\Newsmanager.cs 行: 97
堆栈跟踪:
[SqlException (0x80131904): 对象名 'newsData ' 无效。]
System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) +177
System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +68
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +199
System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +2411
System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) +147
System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) +1038
System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) +314
System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe) +413
System.Data.SqlClient.SqlCommand.ExecuteNonQuery() +115
NewsManager.AddNews(String newsTitle, String newsUser, String newsData) in c:\Documents and Settings\Administrator\桌面\YWcar\App_Code\Newsmanager.cs:97
Admin_addFile.btnOk_Click(Object sender, EventArgs e) in c:\Documents and Settings\Administrator\桌面\YWcar\Admin\addFile.aspx.cs:24
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +75