Currently I have a project that involves two database providers:
- SqlClient
- OleDb
I need to create a DAL that handles these providers. I was thinking to create a interface like this:
public interface IDataAccessLayer
{
public string GetSomeData();
}
And implement it separately (although it's simple this is the wrong way)
public class SqlClientDal : IDataAccessLayer
{
public string GetSomeData() { }
}
public class OleDbDal : IDataAccessLayer
{
public string GetSomeData() { }
}
I have read some post like this:
.Net: how to create vendor independent Dataset, Tableadapters, bindings (DB decided at runtime) (it's good, but it doesn't provide any example)
Creating a Data Access Layer (C#) (really good, but table adapters are vendor dependent)
I would like to create a DAL with this features:
- Use of typed data tables (using visual studio designer)
- Use of vendor independent data adapters (manually created)
- Not ORM
How can I create a simple DAL with these features?