lütfen bunu çözmeme yardım edin ... "Konum 0'da hiç satır yok" şeklinde hata alıyorum, "aralık dışı istisnası dizini tarafından geçersiz kılındı" kullanıcı kodu"Hata alma "0 konumunda bir satır yok"
Aşağıda benim kod
protected void Page_Load(object sender, EventArgs e)
{
MTMSService obj = new MTMSService();
DBAccess db = new DBAccess();
{
MTMSDTO objc = new MTMSDTO();
{
objc.TaskID = Convert.ToInt32(Session["TaskID"]);
DataSet rep = obj.GetReports(objc);
DataView Rprts = new DataView();
Rprts.Table = rep.Tables[0];
LblTaskID.Text = rep.Tables[0].Rows[0]["TaskID"].ToString();
LblTaskName.Text = rep.Tables[1].Rows[0]["TaskName"].ToString();
LblDueDate.Text = rep.Tables[2].Rows[0]["DueDate"].ToString();
LblDescription.Text = rep.Tables[3].Rows[0]["Description"].ToString();
LblAssignBy.Text = rep.Tables[4].Rows[0]["AssignBy"].ToString();
LblStatus.Text = rep.Tables[5].Rows[0]["Status"].ToString();
LblPercentageComplete.Text =
rep.Tables[6].Rows[0]["PercentageComplete"].ToString();
LblTaskName.Visible = true;
LblAssignBy.Visible = true;
LblDescription.Visible = true;
LblDueDate.Visible = true;
LblStatus.Visible = true;
LblPercentageComplete.Visible = true;
LblAssignTo.Visible = false;
}
}
}
Eh, mesaj oldukça açık, değil mi? Ne anlamadın? Rep.Tables [0] 'herhangi bir satır içermiyorsa, 'Satırlar [0]' seçeneğine erişmek bir istisna atar. –
Kullanmaya çalışmadan önce tabloda herhangi bir satır olup olmadığını kontrol edin! –
** Hata ayıklama ** ve ** İzle ** –