May 22, 2013 at 7:54 am
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!
May 22, 2013 at 8:15 am
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
May 22, 2013 at 10:27 am
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
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply