Can someone give me logic in c sharp that's equivalent to the BOF and EOF in visual basic 6.0?
BOF (Not supported)
Returns true if the current record position is before the first record, otherwise false
Command Not Supported
EOF (Not supported)
Returns true if the current record position is after the last record, otherwise false
Command Not Supported
David SmithPosted Oct 14, 2014, 2:47 PM
VulpesPosted Oct 14, 2014, 1:27 PM
Once you have your DataTable (dt, say), you can iterate through its DataRows just like any other collection:
foreach(DataRow dr in dt.Rows)
{
// do something with dr
}
You can also obtain a DataRow directly:
DataRow rowFirst = dt.Rows[0];
DataRow rowLast = dt.Rows[dt.Rows.Count - 1];
It follows that there's no concept of being before the first row or after the last row (BOF or EOF in an ADO RecordSet). You must always be within the row collection itself or you'll get an exception.