DataSet ds = MyDataSetMethod(); foreach ( DataRow dr in ds.Tables[0].Rows ) { for (int i ; i < dr.Count ; i++ ) //Do some stuff ; }