Universal driver for database for visual studio

  • universal driver for database for visual studio. Database may be any thing it may be SQL server, Oracle,MYSQL etc..... what ever database what is the best driver suited for all the database.

    Say today i am using MYSQL database tomorrow i may switch over to SQL server or to some other database.i should not change code in VS just need to change the connection string and it should would with minimum changes at the code rather than changing the whole code.

    Is ODBC will suite ?

    Thanks!

  • ODBC would be my first choice these days but that only covers your connectivity, not the code going against the database. Unless you are writing ANSI-standard SQL that is so simple that you know it will run against any database platform then you might as well start looking into an ORM. Once you go there though, you are giving up a lot of control in terms of what SQL is actually issued to the database. In my experience when doing anything beyond the non-trivial you'll end up writing platform-specific code to get the best performance and in the end it's typically not worth trying to be platform-agnostic. Pick a database platform that suits your needs and use the best tools available on that platform to make your application perform well. Abstract and encapsulate to minimize impacts should you change database platforms, but unless you're building an app for sale to customers that might want to host the database on whatever they have it's typically not a good trade for the effort it takes.

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

  • it's a lot of work;

    you probably want to search for "Data Access layer", which is what will sit between your application and the data below it;

    it abtracts the implementation of select/insert/update/delete, but certainly at a cost of control, like opc.three noted.

    here's the first decent one i found with a quick search:

    http://www.codeproject.com/Articles/158042/DALC4NET-A-Generic-Data-Access-Layer-for-NET

    that one claims support for SQL Server, Oracle, MySQL, Microsoft Access, and Microsoft Excel, but i personally never used it.

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply