i have a data table having several rows.I want to increment a variable say i, only if it is the first row of the data table. Hoe can i do that?
foreach (DataRow row in dt.Rows)
{
address = (row["address"].ToString());
Counter += 1;
int count = Convert.ToInt16(emailFromDt.Rows[i]["limit"]);
//for the first row
if (Counter == count)
{
i += 1;
}
//also if it is the last row
exit;
Aucun commentaire:
Enregistrer un commentaire