Server Error in '/' Application.

Invalid attempt to access a field before calling Read()

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: MySql.Data.MySqlClient.MySqlException: Invalid attempt to access a field before calling Read()

Source Error:


Line 2032:		end if
Line 2033:
Line 2034:		if dr("item_bypassotherads") <> 0 then
Line 2035:			dr.close
Line 2036:			response.redirect("http://www.ebrandon.ca")

Source File: C:\sites\ebrandon\browseads.aspx    Line: 2034

Stack Trace:


[MySqlException (0x80004005): Invalid attempt to access a field before calling Read()]
   MySql.Data.MySqlClient.ResultSet.get_Item(Int32 index) +488
   MySql.Data.MySqlClient.MySqlDataReader.GetFieldValue(Int32 index, Boolean checkNull) +142
   MySql.Data.MySqlClient.MySqlDataReader.GetValue(Int32 i) +173
   MySql.Data.MySqlClient.MySqlDataReader.get_Item(Int32 i) +19
   MySql.Data.MySqlClient.MySqlDataReader.get_Item(String name) +40
   ASP.browseads_aspx.GetSellerEmail(String item_id) in C:\sites\ebrandon\browseads.aspx:2034
   ASP.browseads_aspx.DoAds() in C:\sites\ebrandon\browseads.aspx:706
   ASP.browseads_aspx.Page_Load(Object obj, EventArgs e) in C:\sites\ebrandon\browseads.aspx:155
   System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +25
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +42
   System.Web.UI.Control.OnLoad(EventArgs e) +132
   System.Web.UI.Control.LoadRecursive() +66
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2428


Version Information: Microsoft .NET Framework Version:2.0.50727.8793; ASP.NET Version:2.0.50727.8762