Server Error in '/' Application.

ExecuteReader: CommandText property has not been initialized

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidOperationException: ExecuteReader: CommandText property has not been initialized

Source Error:


Line 145:            DataSet ds = new DataSet();
Line 146:            SqlDataAdapter da = new SqlDataAdapter(query, EstablishtoDB);
Line 147:            da.Fill(ds);
Line 148:
Line 149:            DataTable dt;

Source File: c:\inetpub\vhosts\yunyshop.com\httpdocs\SC2\items.aspx.cs    Line: 147

Stack Trace:


[InvalidOperationException: ExecuteReader: CommandText property has not been initialized]
   System.Data.SqlClient.SqlCommand.ValidateCommand(String method, Boolean async) +829
   System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry) +156
   System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) +84
   System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method) +207
   System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +214
   System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +180
   System.Data.Common.DbDataAdapter.Fill(DataSet dataSet) +126
   RDEPT_items.fillgrid(String coID) in c:\inetpub\vhosts\yunyshop.com\httpdocs\SC2\items.aspx.cs:147
   RDEPT_items.Page_Load(Object sender, EventArgs e) in c:\inetpub\vhosts\yunyshop.com\httpdocs\SC2\items.aspx.cs:63
   System.Web.UI.Control.OnLoad(EventArgs e) +108
   System.Web.UI.Control.LoadRecursive() +90
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1533


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.8.4700.0