Hi All, I'm working on an ASP.Net application that uses .NET 3.5 framework. I need to implement a provider that works well with both Oracle and Sql Server, and also maybe MySql, because we are going to sell the product to clients who may have any one of these databases and the application should be able to communicate with any of these data sources. What is the best approach to implement this? Also, can anyone provide me links to some sample examples? Thank you.
Why do you want to write one dataprovider for all databases? just write configurator that helps clients to configure system for specified database by selecting database type and other database properties, and change app.config file by writing specified dataprovider in your configurator
EDIT
Here are the ways to use DbProviderFactory, you can find more samples in web, just use this classes instead of specified ones Obtaining the DbProviderFactory, Create Provider-Independent Data Access Code with ADO.NET 2.0
You could use the Enterprise Library - which conforms to the provider model. It already has hooks for Oracle and SQL Server and you can extend this into any other database quite easily. We did it at work for DB2.
See more here: http://www.codeplex.com/entlib
Use the .net provider model to create seperate providers for each data source and implement an Inversion of Control Container like Castle .net or Spring to determine which provider to use.
Or use the EntityFramework, the link below includes a whole test project with two different data sources.