DataTable dt = (DataTable)Utils.SessionHandler.Reportgrid;
int RowCnt = dt.Rows.Count;
for (int iCtr=0; iCtr < RowCnt;iCtr++)
if (lstNumber.Items[lstNumber.SelectedIndex].ToString() == dt.Rows[iCtr]["Number"].ToString())
Utils.SessionHandler.Reportgrid = dt;
the above condition is used for a list box that has entries populated from the database. and when i click on them it has to be removed but it
generates the foll exception.
i put a breakpoint two steps above and it breaks out at the if condition.
Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
View Complete Post