what is the best way to identify first row in the following code?
foreach(DataRow row in myrows)
{
if (first row )
{
...do this...
}
else
{
....process other than first rows..
}
}
You can use a boolean flag for this:
bool isFirst = true;
foreach(DataRow row in myrows)
{
if (isFirst)
{
isFirst = false;
...do this...
}
else
{
....process other than first rows..
}
}