R – ASP.NET : database independent data accses layer

.net-3.5data-access-layer

I would like to develop a database independent data access layer for my web application.This data access layer should communicate with any external(as far as my application is concerned) databases like Ms SQL server,Oracle,Access etc… (as per the user's preference) .I will provide various options-various databases like SQL server,Access,Oracle to the user and he can select any one from it ans start doing interacting with the data of that external database. I Will always have an SQL server database also in my Application to which i want to transfer data from the connected eternal database(SQL server/Ms Access/Oracle) .Do i need to have 2 DataAccess Layers ? one for My SQL server db transactions and the other for communicating with the external database.What is the best methods to achieve this ? I am using VS 2008 for development.Which dot net classes support me for this scenario?

Best Answer

You could make an extra abstraction-layer. Maybe call it "Data Persistence Layer", and create contracts for CRUD-operations in that. Then you could use IOC (with, say, structuremap) to map your DAL-implementations to your contracts :)

Related Topic