Click to See Complete Forum and Search --> : Data set


ram_coder2007
March 5th, 2007, 12:14 AM
How could we get records from two tables in dataset
using foreach loop

mcmcom
March 5th, 2007, 10:16 AM
are your tables already in a dataset or are you trying to put them in a dataset?

if they are already in a dataset you can loop through them like

foreach(DataRow r in myDataSet.Tables[0].Rows){
//do something with the Row
int tmp = int.Parse(r.ItemArray(0).ToString());
}


you can also loop through the tables with foreach(DataTable dt in DataSet.Tables){
}

hth,
mcm