The nice thing about ADO.NET is that is stuffs everything into our dataset tables collection.

The code for this:
string sConn = "Data Source=(local);Network Library=DBMSSOCN;Initial Catalog=Northwind;User ID=test;Password=test;";
string sSQL = "select * from products;select * from categories";
DataSet dd = Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteDataset(sConn,
CommandType.Text, sSQL);
dataGridView1.DataSource = dd.Tables[0];
dataGridView2.DataSource = dd.Tables[1];
As you can see the products are put into tables[0] and categories into tables[1].

No comments:
Post a Comment