Unified Data Access for .NET

I certainly going to use this article in a next dScribe release.

Philip Miseldine explain here how you can create a generic class to talk to any database. So you don't have to worry
about the connection (ODBC class type or SQL), but instead you have a generic interface to call your database.

Introduction

Nearly all of today’s Web applications use some sort of database to store persistent data. .NET applications often use SQL Server, PHP applications mostly use MySQL, and so on. When deploying an application to clients, however, there are many occasions on which they may wish to use a different database than that which your application has implemented. They might use Oracle throughout their enterprise, for example, and simply will not use your system as it stands without support for it. It is also far better practice to give the end-user choice rather than tying your system to a single third party database.

UPDATE: Frans Bouma make the point that it's good only for common SQL statements. If you use specific Oracle commands for example.

 

2 Comments

  • ... until you want to use your T-SQL query SELECT * FROM TableA INNER JOIN TableB On TableA.Foo = TableB.Foo on Oracle8i or you want to use your T-SQL query UPDATE Foo Set Bar='value' FROM TableA where TableA.Bar='duh' on Oracle. No-can-do.



    Long story short: the connection creation can be abstracted away, the sql can't.

  • Frans this is what Philip is doing, abstracting the connection. I reckon that it's good enough for some common SQL statements and not specific ones. But if you look at the number of sites doing basic CRUD, this can help to make a project less SQL database dependant.

Comments have been disabled for this content.