System.Data.SqlClient.SqlException: 对象名 'product' 无效
对象名 'product' 无效。说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。
异常详细信息: System.Data.SqlClient.SqlException: 对象名 'product' 无效。
源错误:
行 32:
行 33: //用数据适配器填充DataSet
行 34: da.Fill(ds);
行 35:
行 36: //将数据集中的表跟GirdView控件进行绑定
源文件: e:\项目\product\Default.aspx.cs 行: 34
堆栈跟踪:
[SqlException (0x80131904): 对象名 'product' 无效。]
System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) +1951450
System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +4849003
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +194
System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +2394
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.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior) +10
System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +130
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +287
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet) +94
_Default.Page_Load(Object sender, EventArgs e) in e:\项目\product\Default.aspx.cs:34
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
System.Web.UI.Control.OnLoad(EventArgs e) +99
System.Web.UI.Control.LoadRecursive() +50
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627
版本信息: Microsoft .NET Framework 版本:2.0.50727.4963; ASP.NET 版本:2.0.50727.4971 --------------------编程问答-------------------- 在线等 求大虾帮忙 --------------------编程问答-------------------- 在线等 求大虾帮忙 --------------------编程问答-------------------- 在线等 求大虾帮忙 --------------------编程问答-------------------- 一看这错误就是要么是名称写错了。
要么是你读取的数据表中没有这个字段,或是你数据库中压根就没有这张表。
对照数据库表字段检查,这些大都是粗心导致的。
--------------------编程问答-------------------- 强烈要求LZ把sql好好看一下。。。。。。 --------------------编程问答-------------------- 一看就知道是数据库相对应的表中没有'product'字段! --------------------编程问答--------------------
嗯 字段或者表名错误
补充:.NET技术 , C#