Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Combing Multiple datasets to one to bind to a datagrid

Status
Not open for further replies.

jcash35010

Programmer
Jul 22, 2003
21
0
0
US
Anyone with any ideas? I have several datasets that all have the same columns, but different data. I need to combine these all into one dataset to be able to bind them to one datagrid. I know I could query the database for just one datagrid, but I am not able to in this case. I have to query the database for each one separately.

Any help would be greatly appreciated!!!
 
You will need to do something like the following. Fill the SAME table in the dataset after each query. When you are finished querying the database, dataset will contain all the data.

DataAdapter.SelectCommand = "Select * from Table1"
DataAdapter.Fill(dataset,"Data")

DataAdapter.SelectCommand = "Select * from Table2"
DataAdapter.Fill(dataset,"Data")

DataAdapter.SelectCommand = "Select * from Table3"
DataAdapter.Fill(dataset,"Data")

Scott
Programmer Analyst
<{{><
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top