punjabtechnicaluniversity.blogspot.in
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 “DataTable” object’s 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” DataTable , use Tables collection of DataSet and the Defaultview object will give you the necessary output.
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 “DataTable” object’s 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” DataTable , use Tables collection of DataSet and the Defaultview object will give you the necessary output.
0 comments:
Post a Comment
North India Campus