In order to make your application work with multiple database types, you will have to use interfaces and abstract classes throughout the code for database operations. Your code should make use of IDbConnection interface or DbConnection and similar classes rather than concrete classes.
Of course, this assumes that all the providers that you are going to use implement or extend the aforementioned interfaces and classes.
In order to keep your application "Loosely coupled", you can either write your own code to do so or use one of the existing frameworks available on the web.
This[
^] page shows a lot of third party readily available containers that can e used here.
Another roadblock I can see here is the query syntax. If there is drastic difference between query syntax used across the database, I would suggest have your own little query syntax implemented in code and then parse it according to the database that user selects.