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 725:            html += "<div style=\"padding-left: 7px; background-image: url(skins/skin_(!SKINID!)/images/HPProductHeader.jpg);";
Line 726:            html += "padding-top: 7px; background-repeat: no-repeat; height: 24px\">";
Line 727:            html += "<span style=\"font-weight: bold; font-size: 12px; color: #ffffff\">" + reader["CategoryName"].ToString() + "</span></div>";
Line 728:            html += "</td>";
Line 729:            html += "</tr>";

Source File: c:\Inetpub\websites\BRHD\brucerossmeyer.com\App_Code\functions.cs    Line: 727

Stack Trace:


[InvalidOperationException: Invalid attempt to read when no data is present.]
   System.Data.SqlClient.SqlDataReader.GetValue(Int32 i) +137
   System.Data.SqlClient.SqlDataReader.get_Item(String name) +24
   functions.HarleyHomePageItems(Int32 CategoryID) in c:\Inetpub\websites\BRHD\brucerossmeyer.com\App_Code\functions.cs:727
   AspDotNetStorefront.SkinBase.ReplaceTokens(String s) in c:\Inetpub\websites\BRHD\brucerossmeyer.com\App_Code\SkinBase.cs:558
   AspDotNetStorefront.SkinBase.ProcessControl(Control ctl, Boolean includeChildren) in c:\Inetpub\websites\BRHD\brucerossmeyer.com\App_Code\SkinBase.cs:375
   AspDotNetStorefront.SkinBase.IterateControls(ControlCollection controls) in c:\Inetpub\websites\BRHD\brucerossmeyer.com\App_Code\SkinBase.cs:358
   AspDotNetStorefront.SkinBase.Render(HtmlTextWriter writer) in c:\Inetpub\websites\BRHD\brucerossmeyer.com\App_Code\SkinBase.cs:429
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +25
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +121
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +22
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2558


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