Search code examples
c#.netc#-4.0data-access-layer

Is there any way in .NET, other then Oledb to be database independent


Is there a way my DAL classes can be re used across different databases ?

I know some technologies (Linq and EF) support rapid development, I appreciate this feature but I also want to keep my DAL Code reuse able in different database.

A Simple thing that come to mind is use of Oledb with inline SQL queries, Is there a more elegant way ? please guide me. I am just considering 2 things.

  1. support to 4 most commonly used databases (SQL Server, My SQL, Access, Oracle).
  2. Rapid development support.

Thanks


Solution

  • Entity Framework does the work you want. The most commonly used databases support it, with the exception of Oracle. For Oracle, you have to use third-party components as the official Oracle support for Entity Framework is still in beta.