I am developing an application. Client wants application to run on two databases, SQL Server Compact Edition and SQL Server.
Now the problem is in Visual Studio in dataset you have to program twice for different database.
That will double my work. Is there any way I could use same dataset and datatable code to interact with both the objects?
By using
DbProviderFactories(see http://msdn.microsoft.com/en-us/library/wda6c36e.aspx) it’s possible to specify provider in the connection string and write code that works with multiple providers (different databases).Then make sure that your code uses base classes such as
DbConnectionandDbDataReaderinstead of provider specific classes likeSqlConnectionandSqlDataReader.