Home All Groups Group Topic Archive Search About

Multiple providers with typed tableadapter

Author
20 Mar 2007 2:37 PM
Polaris431
I am using VS 2005 and created a dataset using the designer. I have
two different data sources although both have the same schema. One is
a SQL Server 2005 database while the other is a SQL Server 2005
Mobile. In the designer a connection is automatically setup when I
drag a table to the designer. Initially it is set to use the SQL
Server 2005 database. At runtime however, I want to optionally switch
to using the SQL Server 2005 Mobile database. The problem is, is that
the tableadapter is strongly typed to a SQL Server 2005 Connection and
not a Mobile Connection. I simply cannot create a connection object
from SQL Server 2005 Mobile and attach it to the tableadapter
connection object.

So how do I switch to a different provider when using typed
tableadapters?

Thanks
Polaris

Author
20 Mar 2007 4:32 PM
Miha Markic [MVP C#]
Hi there,

See my reply in "How to refresh a typed dataset in Visual Studio 2005" few
threads below.
In your case (dealing with different databases) an ORM solution would really
fit well.

--
Miha Markic [MVP C#, INETA Country Leader for Slovenia]
RightHand .NET consulting & development www.rthand.com
Blog: http://cs.rthand.com/blogs/blog_with_righthand/

Show quote
"Polaris431" <polaris***@gmail.com> wrote in message
news:1174401449.914812.42660@n76g2000hsh.googlegroups.com...
>I am using VS 2005 and created a dataset using the designer. I have
> two different data sources although both have the same schema. One is
> a SQL Server 2005 database while the other is a SQL Server 2005
> Mobile. In the designer a connection is automatically setup when I
> drag a table to the designer. Initially it is set to use the SQL
> Server 2005 database. At runtime however, I want to optionally switch
> to using the SQL Server 2005 Mobile database. The problem is, is that
> the tableadapter is strongly typed to a SQL Server 2005 Connection and
> not a Mobile Connection. I simply cannot create a connection object
> from SQL Server 2005 Mobile and attach it to the tableadapter
> connection object.
>
> So how do I switch to a different provider when using typed
> tableadapters?
>
> Thanks
> Polaris
>
Author
20 Mar 2007 6:53 PM
Polaris431
But I don't want to refresh in VS. I want to change to a different
provider during run-time.
Author
20 Mar 2007 8:16 PM
Miha Markic [MVP C#]
The story is the same...vs designer isn't meant to do things like that thus
a wise move is to search for an alternative or start coding every adapter.

--
Miha Markic [MVP C#, INETA Country Leader for Slovenia]
RightHand .NET consulting & development www.rthand.com
Blog: http://cs.rthand.com/blogs/blog_with_righthand/

Show quote
"Polaris431" <polaris***@gmail.com> wrote in message
news:1174416821.653215.316330@l75g2000hse.googlegroups.com...
> But I don't want to refresh in VS. I want to change to a different
> provider during run-time.
>

AddThis Social Bookmark Button