You should try a foreach loop like this:
DataTable dt = new DataTable();
foreach (DataRow dr in dt.Rows)
{
}
That way you never have to check whether you are on the last row or not, also you have a strongly typed DataRow to work with.
Hope this helps