Server Error in '/' Application.

Invalid attempt to call Read when reader is closed.

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: Invalid attempt to call Read when reader is closed.

Source Error:


Line 156:            head.Controls.Add(llc);
Line 157:
Line 158:            LiteralControl lc = new LiteralControl(StructureData.getProduct(dt.Rows[0]["brand_name"].ToString(), product_name, psc_id));
Line 159:
Line 160:            head.Controls.Add(lc);

Source File: d:\Plesk\Vhosts\pakcosmetics.com\httpdocs\product.aspx.cs    Line: 158

Stack Trace:


[InvalidOperationException: Invalid attempt to call Read when reader is closed.]
   System.Data.SqlClient.SqlDataReader.TryReadInternal(Boolean setTimeout, Boolean& more) +915
   System.Data.SqlClient.SqlDataReader.Read() +43
   System.Data.Common.DataAdapter.FillLoadDataRow(SchemaMapping mapping) +166
   System.Data.Common.DataAdapter.FillFromReader(DataSet dataset, DataTable datatable, String srcTable, DataReaderContainer dataReader, Int32 startRecord, Int32 maxRecords, DataColumn parentChapterColumn, Object parentChapterValue) +219
   System.Data.Common.DataAdapter.Fill(DataTable[] dataTables, IDataReader dataReader, Int32 startRecord, Int32 maxRecords) +420
   System.Data.DataTable.Load(IDataReader reader, LoadOption loadOption, FillErrorEventHandler errorHandler) +251
   MHB.DBHandler.getVariationsData(String productid) in D:\LocalSites\goodwin-ecommerce-html-template\PaksGoodwin_202307\PaksNewSite-Net-40_CustomerHandler\DBHandler.cs:121
   Logistics.StructureData.GetVariationData(String productid) +52
   Logistics.StructureData.getProduct(String brand_name, String style, Int32 pscid) +242
   product.setProductListing() in d:\Plesk\Vhosts\pakcosmetics.com\httpdocs\product.aspx.cs:158
   product.Page_Load(Object sender, EventArgs e) in d:\Plesk\Vhosts\pakcosmetics.com\httpdocs\product.aspx.cs:101
   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.4494.0