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 13:     {
Line 14:         DataTable dt = SqlProvider.DataTableGetir("select TOP(1) * from kariyerProgram order by programID DESC");
Line 15:         int kariyersayi = Convert.ToInt32(dt.Rows[0]["sayi"]);
Line 16:         DataTable dtyazi = SqlProvider.DataTableGetir("select * from kariyeregitimciler where kariyerid ='" + kariyersayi + "' and yayin='True' order by sira ASC");
Line 17:         if (dtyazi.Rows.Count > 0)

Source File: e:\Web\gencliksporkariyer.ibb.gov.tr\egitimciler.aspx.cs    Line: 15

Stack Trace:


[IndexOutOfRangeException: There is no row at position 0.]
   System.Data.RBTree`1.GetNodeByIndex(Int32 userIndex) +181
   System.Data.RBTree`1.get_Item(Int32 index) +16
   egitimciler.Page_Load(Object sender, EventArgs e) in e:\Web\gencliksporkariyer.ibb.gov.tr\egitimciler.aspx.cs:15
   System.Web.UI.Control.OnLoad(EventArgs e) +104
   System.Web.UI.Control.LoadRecursive() +112
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2164


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