Tuesday, July 17, 2012 1:02 PM
Hi I am working on n tier application but i am having trouble figuring out how to control what database the Data layer is talking to.
at the moment we just re-link it at compile time with new data sources but i need a way to re-link at run time, can any one help?
Tuesday, July 17, 2012 2:40 PM
Regarding DataSets, the layer is independent from the data source.
Classes like OleDbConnection and SqlConnection inherit from DbConnection so that it is the abstract type that can be used allover instead of the specific types.
So it's narrowed down to one database specific line creating the connection. IF you put it in a Dll and built a small plug-in system, all you need to do is replace the dll. EDIT: Assuming you do not just want a "Select Case" to select the database engine. There can be several approaches to tackle this problem. The best solution is very individual.