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 254:        dbReader.Read()
Line 255:
Line 256:        If Not Convert.IsDBNull(dbReader.Item("ProductID")) Then
Line 257:            testttttt = dbReader.Item("ProductID").ToString()
Line 258:        End If

Source File: C:\inetpub\www_DataSheetPDF\datasheet\Example_StoredProcedures.vb    Line: 256

Stack Trace:


[InvalidOperationException: Invalid attempt to read when no data is present.]
   System.Data.SqlClient.SqlDataReader.GetValue(Int32 i) +185
   PDFPage.AddMarketingCol(Grid p_grid, String p_text, Style p_style, Int32 p_id) in C:\inetpub\www_DataSheetPDF\datasheet\Example_StoredProcedures.vb:256
   Example.LoadPdf(Single p_ID) in C:\inetpub\www_DataSheetPDF\datasheet\Example_StoredProcedures.vb:1133
   Example.Page_Load(Object Src, EventArgs e) in C:\inetpub\www_DataSheetPDF\datasheet\Example_StoredProcedures.vb:967
   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.9061; ASP.NET Version:2.0.50727.9062