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 40:             ListView1.DataSource = dt;
Line 41:             ListView1.DataBind();
Line 42:             Label1.Text = dt.Rows[0]["donate_year"].ToString();
Line 43:             Label2.Text = dt.Rows[0]["donate_month"].ToString();
Line 44:         }

Source File: c:\tatzu(大慈育幼院VB版)\models\donate\donate_user_detail_taichi.aspx.cs    Line: 42

Stack Trace:


[IndexOutOfRangeException: There is no row at position 0.]
   System.Data.RBTree`1.GetNodeByIndex(Int32 userIndex) +2483230
   System.Data.DataRowCollection.get_Item(Int32 index) +21
   models_donate_donate_user_detail_taichi.ListViewBind() in c:\tatzu(大慈育幼院VB版)\models\donate\donate_user_detail_taichi.aspx.cs:42
   models_donate_donate_user_detail_taichi.Page_Load(Object sender, EventArgs e) in c:\tatzu(大慈育幼院VB版)\models\donate\donate_user_detail_taichi.aspx.cs:19
   System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +25
   System.Web.UI.Control.LoadRecursive() +71
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3064


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