Server Error in '/' Application.

Column 'LegalStatus' does not belong to table Table1.

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.ArgumentException: Column 'LegalStatus' does not belong to table Table1.

Source Error:


Line 53:             {
Line 54:                 divContent.InnerHtml += "<div class='row'>";
Line 55:                 if (Convert.ToString(ds.Tables[1].Rows[0]["LegalStatus"]) != "")
Line 56:                 {
Line 57:                     divContent.InnerHtml += "<div class='col-lg-4 col-md-6 mb-2'><div class='card bg-white py-2 px-4'><strong>Legal Status</strong>: " + Convert.ToString(ds.Tables[1].Rows[0]["LegalStatus"]) + "</div></div>";

Source File: c:\inetpub\wwwroot\ClassicStore\CustomPage.aspx.cs    Line: 55

Stack Trace:


[ArgumentException: Column 'LegalStatus' does not belong to table Table1.]
   System.Data.DataRow.GetDataColumn(String columnName) +3107757
   System.Data.DataRow.get_Item(String columnName) +18
   CustomPage.PageData(String PageURL) in c:\inetpub\wwwroot\ClassicStore\CustomPage.aspx.cs:55
   CustomPage.Page_Load(Object sender, EventArgs e) in c:\inetpub\wwwroot\ClassicStore\CustomPage.aspx.cs:17
   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.4682.0