Server Error in '/' Application.

Invalid attempt to read when no data is present.

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 read when no data is present.

Source Error:


Line 61:         rdr.Read()
Line 62: 
Line 63:         Dim data As Byte() = CType(rdr(fld), Byte())
Line 64: 
Line 65:         rdr.Close()

Source File: e:\InetPub\www.foxgastro.cz\www\obrazek.aspx    Line: 63

Stack Trace:


[InvalidOperationException: Invalid attempt to read when no data is present.]
   System.Data.SqlClient.SqlDataReader.GetValue(Int32 i) +118
   System.Data.SqlClient.SqlDataReader.get_Item(String name) +27
   ASP.obrazek_aspx.Page_Load(Object sender, EventArgs e) in e:\InetPub\www.foxgastro.cz\www\obrazek.aspx:63
   System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
   System.Web.UI.Control.OnLoad(EventArgs e) +99
   System.Web.UI.Control.LoadRecursive() +50
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627


Version Information: Microsoft .NET Framework Version:2.0.50727.8974; ASP.NET Version:2.0.50727.8974