|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Multiple providers with typed tableadapterI 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 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. -- Show quoteMiha Markic [MVP C#, INETA Country Leader for Slovenia] RightHand .NET consulting & development www.rthand.com Blog: http://cs.rthand.com/blogs/blog_with_righthand/ "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 > But I don't want to refresh in VS. I want to change to a different
provider during run-time. 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. -- Show quoteMiha Markic [MVP C#, INETA Country Leader for Slovenia] RightHand .NET consulting & development www.rthand.com Blog: http://cs.rthand.com/blogs/blog_with_righthand/ "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. >
Other interesting topics
How do i move an SQLDatabase to another location?
Child Aggregate Filter Not Recognising Newly Added Child Rows (ADO.NET 2.0 Dataset) How do you clear a datatable? dataset designer - building data access layer - how to close connect on exception Simple problem: Why does this cause a massive memory leak? |
|||||||||||||||||||||||