Hi,
You can use something like below:
DataSet ds = new DataSet();
DataTable dt = new DataTable();
da.SelectCommand = new SqlCommand(@"SELECT * FROM dbo.MyTable", connString);
da.Fill(ds, "dbo.MyTable");
dt = ds.Tables["dbo.MyTable"];
foreach (DataRow dr in dt.Rows)
{
Label1.Text=dr["Column1"].ToString();
Label2.Text=dr["Column1"].ToString();
}
The above is a method, but it will have performance issues when you have a large table in the database, coz the table will be queried everytime and it will add a overhead to your code.In that case you can pull the whole table in a datatable at once and use it.
Hope it helps.
Regards
Anurag