Server Error in '/' Application.

There is no row at position 0.

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.IndexOutOfRangeException: There is no row at position 0.

Source Error:


Line 9:          Dim dt As DataTable
Line 10:         dt = objNews.GetNoticeById(id)
Line 11:         lblHeading.Text = "<div style='text-align:justify;color:#117BB4 !important;font-size:16px;float:left;'><b>" & dt.Rows(0).Item("Heading") & "</b><br><span style='text-decoration:None;text-align:justify;color: darkblue !important; font-size:11px;'>Update on:" & CDate(dt.Rows(0).Item("NoticeDate")).ToString("dd-MMM-yyyy") & "</span></div>"
Line 12:         If Not dt.Rows(0).Item("DownloadProd").ToString() = "" Then
Line 13:             lblHeading.Text += "<div style='float:right;top:0;text-align:center;padding-left:10px;'><a href='/Downloads.aspx?Doc=" & dt.Rows(0).Item("DownloadProd") & "' style='text-decoration:none;' target='_blank'><img src='/images/pdf.png' width='30px'/><br>Download</a></div><div style='float:right;top:0;text-align:center;'><a href='/DownloadMat/" & dt.Rows(0).Item("DownloadProd") & "' style='text-decoration:none;' target='_blank'><img src='/images/ViewNews.png' width='30px'/><br>View</a></div>"

Source File: D:\Websites\SacredheartKGNJweb\Notices\FullNotice.aspx.vb    Line: 11

Stack Trace:


[IndexOutOfRangeException: There is no row at position 0.]
   System.Data.RBTree`1.GetNodeByIndex(Int32 userIndex) +2562189
   System.Data.RBTree`1.get_Item(Int32 index) +16
   System.Data.DataRowCollection.get_Item(Int32 index) +16
   FullNotice.Record(Int32 id) in D:\Websites\SacredheartKGNJweb\Notices\FullNotice.aspx.vb:11
   FullNotice.Page_Load(Object sender, EventArgs e) in D:\Websites\SacredheartKGNJweb\Notices\FullNotice.aspx.vb:20
   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