I want to to know how to check there is a row in specific index to avoid the following exception :
System.IndexOutOfRangeException
for example :
if (dtNew != null && dtNew.Rows.Count > 0 )
{
if (dtNew.Rows[i][0] != null)
{
row["newEmp"] = dtNew.Rows[i][0];
}
else
{
row["newEmp"] = 0;
}
}
What if dtNew has just a one row and the i = 3 !!
Countof it