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 1815:                    using (DataSet ds = new DataSet())
Line 1816:                    {
Line 1817:                        sda.Fill(ds, "Customers");
Line 1818:                        DataTable dt = new DataTable("PageCount");
Line 1819:                        dt.Columns.Add("PageCount");

Source File: d:\domains\sparklingdirect.co.uk\wwwroot3\category.aspx.cs    Line: 1817

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, String srcTable) +123
   category.GetData(SqlCommand cmd) in d:\domains\sparklingdirect.co.uk\wwwroot3\category.aspx.cs:1817
   category.GetCustomersData(Int32 pageIndex, String sortby, String brandid, String catid, String minprice, String maxprice) in d:\domains\sparklingdirect.co.uk\wwwroot3\category.aspx.cs:1803
   category.Page_Load(Object sender, EventArgs e) in d:\domains\sparklingdirect.co.uk\wwwroot3\category.aspx.cs:1573
   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.4667.0