Joining tables from different databases

Vrom

Member
Joined
Feb 27, 2007
Messages
6
Programming Experience
1-3
Hey guys.

I was wondering if it is possible to join two tables from different databases together.

Here is what I want to do:

TableAdapter1 would get data from file AccessDB1, from Table1.
TableAdapter2 would get data from file AccessDB2, from Table2.

Once this is done, I want to join/merge/connect the two tables together in a new DataTable in memory and be able to query this new table.

An example of what I want to do is this:

I have two Access files. The first contains Table1 that has a date column and a value column. The second Access file contains Table2 that has a date column and an exchange rate column.
What I want to do is to produce a new table in memory (i.e. Datatable) that will contain a date column, a value column, and exchange rate column, AND a new column ExchangedValue that will contain the results of value column * exchange rate column.

Can this be done? The concern here is the fact that the two tables where taken from different database files.

Thanks and regards..
 
How??????????

Thanks for taking your time to read this but could you give a bit more info on this.

The keys match but what to do next??????????
 
table1: id, a, b, c
table2: id, d, e, f

mergetable: id, a, b, c, d, e, f

table1TableAdapter.Fill(table1)
table2TableAdapter.Fill(table2)

Dim mt as New mergetable
mt.Merge(table1)
mt.Merge(table2)
 
Back
Top