msyed1
asked on
Bind Data to Datagrid from Multiple Sources
Hello,
I have a Search application that performs Search and displays results in a datagrid. The search has to be done against two different databases. My 1st datasource is a dataset, but my 2nd datasource is an arraylist (but exactly in the same order that the datagrid expects it to be). I am not sure how to assign the 2nd datasource to the dataadapter, and then bind the two at one time, so when the datagrid is displayed, the results from the two sources display as one.
I need ideas and examples (VB.Net). Should I combine the results from the first datasource with the 2nd and Bind at one time or can I do a 2nd Bind after the first Bind ? Here is my first Bind code.
If I need to I can create the 2nd datasource as a dataset also, if that is more advisable.....
''''' Create Adapter and pass the SQL string
Dim daTPCSSearchResults As New System.Data.SqlClient.SqlD ataAdapter (strBuildS tring, TPCSConnection)
Dim ds As New DataSet
daTPCSSearchResults.Fill(d s)
dgTPCSSearchResults.DataBi nd()
I have a Search application that performs Search and displays results in a datagrid. The search has to be done against two different databases. My 1st datasource is a dataset, but my 2nd datasource is an arraylist (but exactly in the same order that the datagrid expects it to be). I am not sure how to assign the 2nd datasource to the dataadapter, and then bind the two at one time, so when the datagrid is displayed, the results from the two sources display as one.
I need ideas and examples (VB.Net). Should I combine the results from the first datasource with the 2nd and Bind at one time or can I do a 2nd Bind after the first Bind ? Here is my first Bind code.
If I need to I can create the 2nd datasource as a dataset also, if that is more advisable.....
''''' Create Adapter and pass the SQL string
Dim daTPCSSearchResults As New System.Data.SqlClient.SqlD
Dim ds As New DataSet
daTPCSSearchResults.Fill(d
dgTPCSSearchResults.DataBi
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
or if both the datatables have a different format, just convert them both to a same format datatable