Hi,
I want to add more than one table in dataset. how i can please suggest me.
For example
Gridview1.datasource= ds.table[2];
It mean dataset contain three table reference. so provide me code through which i can add more than one table reference in dataset.
Loading
Hemant SrivastavaPosted Nov 12, 2012, 2:31 PM
e.g.
DataSet customerOrders = new DataSet("CustomerOrders");
DataTable ordersTable = customerOrders.Tables.Add("Orders");
DataColumn pkOrderID =
ordersTable.Columns.Add("OrderID", typeof(Int32));
ordersTable.Columns.Add("OrderQuantity", typeof(Int32));
ordersTable.Columns.Add("CompanyName", typeof(string));
ordersTable.PrimaryKey = new DataColumn[] { pkOrderID };
Veerabhadram DhodlaPosted Nov 6, 2012, 6:00 AM
Now bind your data set to that Stored Procedure. Automatically your dataset will get 3 tables