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 937:                MetaTitle = read1("MetaTitle") & ""
Line 938:            End If
Line 939:            metaDescription = read1("MetaDescription") & ""
Line 940:            ParentIName = String.Format("<div style=""line-height:normal;padding:10px;background-color:#EBF4BD;color:#C0382A;font-size:22px;"">" & I1Name & "</div>")
Line 941:            ParentIDef = IIf(read1("DefinitiveImage") Is DBNull.Value, "", "<img style=""float:left;margin:5px;margin-left:0px;margin-right:15px;"" src=""glossary/ing/" & read1("definitiveimage") & """/>")

Source File: D:\Webroot\td2k8r2-64\tdcpreview.dytelworld.com\Glossary.aspx.vb    Line: 939

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
   Glossary.ViewP1Ingredient(Int64 P1ICode) in D:\Webroot\td2k8r2-64\tdcpreview.dytelworld.com\Glossary.aspx.vb:939
   Glossary.Page_Load(Object sender, EventArgs e) in D:\Webroot\td2k8r2-64\tdcpreview.dytelworld.com\Glossary.aspx.vb:140
   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.5485; ASP.NET Version:2.0.50727.5491