Server Error in '/' Application.

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

Source Error:


Line 41: End If
Line 42: 
Line 43: Dim listingId As String = reader("ID")
Line 44: Dim company As String = reader("Company")
Line 45: Dim address As String = reader("Address")

Source File: C:\home\site\wwwroot\services\listing.aspx    Line: 43

Stack Trace:


[InvalidOperationException: Invalid attempt to call MetaData when reader is closed.]
   System.Data.SqlClient.SqlDataReader.get_MetaData() +4937500
   System.Data.SqlClient.SqlDataReader.GetOrdinal(String name) +98
   System.Data.SqlClient.SqlDataReader.get_Item(String name) +15
   ASP.services_listing_aspx.__Render__control1(HtmlTextWriter __w, Control parameterContainer) in C:\home\site\wwwroot\services\listing.aspx:43
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +256
   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +19
   System.Web.UI.Page.Render(HtmlTextWriter writer) +29
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +99
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1266


Version Information: Microsoft .NET Framework Version:2.0.50727.9174; ASP.NET Version:2.0.50727.9175