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:  
Line 10: <asp:Content ID="Meta" ContentPlaceHolderID="Meta" Runat="Server">
Line 11:     <title><%=TheStaff.Rows[0]["title"] %> <%=TheStaff.Rows[0]["firstname"] %> <%=TheStaff.Rows[0]["surname"] %> - Profile at Bromsgrove School</title>
Line 12:     <meta name="keywords" content="Bromsgrove School,<%=TheStaff.Rows[0]["title"] %>, <%=TheStaff.Rows[0]["firstname"] %>, i<%=TheStaff.Rows[0]["surname"] %>" />
Line 13:     <meta name="description" content="Profile at Bromsgrove School - <%=TheStaff.Rows[0]["title"] %> <%=TheStaff.Rows[0]["firstname"] %> <%=TheStaff.Rows[0]["surname"] %>" />

Source File: c:\IIS\bromsgrove-school.co.uk\Template7.aspx    Line: 11

Stack Trace:


[IndexOutOfRangeException: There is no row at position 0.]
   System.Data.RBTree`1.GetNodeByIndex(Int32 userIndex) +2519202
   System.Data.DataRowCollection.get_Item(Int32 index) +20
   ASP.template7_aspx.__RenderMeta(HtmlTextWriter __w, Control parameterContainer) in c:\IIS\bromsgrove-school.co.uk\Template7.aspx:11
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +276
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +80
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +169
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +80
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +169
   Core.Web.ProtectedPage.Render(HtmlTextWriter writer) in C:\Users\Murat\Documents\Visual Studio 2010\Projects\Core.Web.ProtectedPage\WebFormsProtection\ProtectedPage.cs:38
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +80
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +4239


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.8.4494.0