We help IT Professionals succeed at work.

Link sdf database to access database so tables can be updated in a dataset VB.net

taz8020
taz8020 used Ask the Experts™
on
Is there a way to link .sdf databases to an access database. I want to be able to update tables in in one from another?
I have both tables showing in a single typed data set. But how do i link the 2 so I can run sql satements on both. Hope this makes sence.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Expert of the Quarter 2010
Expert of the Year 2010

Commented:
> But how do i link the 2 so I can run sql satements on both.

If you mean to have a sql statement run against both at the same time, then no.
You will need to code the sql joins in VB.Net by processing 2 separate DataSets, one from each of SQL CE and Access.

Author

Commented:
Hi Cyberkiwi,
Thanks I was hoping there was a way of joining them in the same dataset.
So if I should have 2 different datasets say one Access_dataset and one SDF_Local_dataset and each of these has a table called customers with the same datatypes and colomns. How do I write an sql join for them?

Expert of the Quarter 2010
Expert of the Year 2010
Commented:
You cannot write an sql to join them, because they exist in separate spaces.  They can both be reached by your .net app, but any "join"ing will have to be done via custom code by playing around with the DataTables from each source, in memory.

If you want to run real SQL over the queries, you could dump a DataSet from .sdf to a temp table in the Access db, or both to a Sql Server database (if size is not large) - before you start the query.

Author

Commented:
Ok I like that Idea, so if i fill a datatable in one dataset, how do i put that into another?
They both will have the same schema.

Author

Commented:
I think I know how to do this now.