Define, how can we load multiple tables in a Dataset?

Define, how can we load multiple tables in a Dataset?

objCommand.CommandText = "Tab1"
objDataAdapter.Fill(objDataSet, "Tab1")
objCommand.CommandText = "Tab2"
objDataAdapter.Fill(objDataSet, "Tab2")

Above code shows how to load multiple Data Table objects in one Dataset object. Sample code shows two tables Tab1 and Tab2 in object ObjDataSet.
lstdata.DataSource = objDataSet.Tables("Tab1").DefaultView
In order to refer Tab1 Data Table, use Tables collection of Datasets and the Default view object will give you the necessary output.

By:Aditya
Date:2029-10-10 00:00:00

Post Your Answers


User Email:

User Name:
Answers:

Related ADO.NET Subjective Links

ADO.NET Subjective interview questions and answers for experienced and fresher