Hi
I am getting this error after dt.delete()
C#
foreach (DataRow row in dt.Rows)
{
if (ND == (dtCount - 1) - init && (Convert.ToInt32(row[3].ToString().Trim()) (Convert.ToInt32(HRpl))))
{
row.Delete();
}
}Thanks
Hi
I am getting this error after dt.delete()
foreach (DataRow row in dt.Rows)
{
if (ND == (dtCount - 1) - init && (Convert.ToInt32(row[3].ToString().Trim()) (Convert.ToInt32(HRpl))))
{
row.Delete();
}
}Thanks
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Sachin SinghRank #66 · 26.2K reputationPosted May 7, 2023, 1:19 PM EDT
better use DataSet
int i=0; foreach (DataRow row in dt.Rows) { if (ND == (dtCount - 1) - init && (Convert.ToInt32(row[3].ToString().Trim()) (Convert.ToInt32(HRpl)))) { ds.Tables[0].Rows[i].Delete(); ds.AcceptChanges(); } i++; }