title: Configurable Data Access Layer For Different Databases
body: <p>I want to build a configurable data access layer for different databases.</p>
  
  <p>We are developing a product (web based application) and the client can choose either MS Access or Sql as backend database.</p>
  
  <p>So, I want to develop a data access layer such that if one client wants to use MS Access as backend then I would use inline queries (dynamic queries) for data access and if another client wants to use Sql as backend then I would use stored procedures for data access.</p>
  
  <p>Please help me designing this kind of architecture and it should be configurable.</p>
  
  <p>Here what I am trying to achieve is having separate layer for Model and DAL; When I call DAL methods from Page it should call with respect to type of database.</p>
  
  <p>Model</p>
  
  <ul>
  <li>Employee
  <ul>
  <li>ID</li>
  <li>Name</li>
  </ul></li>
  </ul>
  
  <p>DAL</p>
  
  <ul>
  <li><p>EmployeeAccessDb (Uses inline queries)</p>
  
  <ul>
  <li>GetAll</li>
  <li>GetByID</li>
  <li>Insert</li>
  <li>Update</li>
  <li>Delete</li>
  </ul></li>
  <li><p>EmployeeSqlDb (Uses stored procedures)</p>
  
  <ul>
  <li>GetAll</li>
  <li>GetByID</li>
  <li>Insert</li>
  <li>Update</li>
  <li>Delete</li>
  </ul></li>
  </ul>
  
  <p>Page</p>
  
  <ul>
  <li>ObjectDataSource SelectMethod="GetAll" TypeName=" &lt; EmployeeAccessDb / EmployeeSqlDb >"</li>
  <li>Insert</li>
  <li>Update</li>
  <li>Delete</li>
  </ul>