int i;
while (dataset.table["mytable"].rows[i] != null)
{
// do some work
i++;
}
once i reaches the value where there is no corresponding record, c# will issue an exception
I worked around it with the following code:
foreach (DataRow row in ds.Tables[0].Rows) // do work
but i am not sure why the first code does not work
thnx
This post has been edited by AdamSpeight2008: 17 August 2010 - 09:30 PM
Reason for edit:: Fixing Code tags :code:

New Topic/Question
Reply




MultiQuote



|