1.

How Can We Load Multiple Tables In A Dataset?

Answer»

Answer : objCommand.CommandText = "Table1"
objDataAdapter.Fill(objDataSet, "Table1")
objCommand.CommandText = "TABLE2"
objDataAdapter.Fill(objDataSet, "Table2")

Above is a sample code, which shows how to load MULTIPLE “Data Table” OBJECTS in one “Dataset” OBJECT. Sample code shows two tables “Table1” and “Table2” in object ObjDataSet.

lstdata.DataSource = objDataSet.Tables("Table1").DefaultView

In order to refer “Table1” Data Table, use Tables COLLECTION of Datasets and the Default view object will give you the necessary output.

Above is a sample code, which shows how to load multiple “Data Table” objects in one “Dataset” object. Sample code shows two tables “Table1” and “Table2” in object ObjDataSet.

lstdata.DataSource = objDataSet.Tables("Table1").DefaultView

In order to refer “Table1” Data Table, use Tables collection of Datasets and the Default view object will give you the necessary output.



Discussion

No Comment Found