Quoting by dataset
While looping through the dataset that the piece of code should use, should I go to 2 foreach or one for
snippet1:
for (int i = 0; i < ds.Tables["TableName"].Rows.Count; i++)
{
// My Code
}
snippet2:
foreach (DataRow dr in ds.Tables["TableName"].Rows)
{
foreach (DataColumn dc in ds.Tables["TableName"].Columns)
{
//My Code
}
}
+1
a source to share
3 answers