Yes, you need to use the interface IDataAccessAdapter.
You also need a factory class to return the correct data adapter to use. You can find some examples of such factories on the forum. This is roughly what we are doing in our factory method:
public class DataAccessAdapterFactory
{
public static IDataAccessAdapter GetDataAdapter(string DBName)
{
switch(DBName)
{
case "SQLServer":
string = conString
... build connection string from configuration
daToReturn = new SqlServer.DataAccessAdapter(conString,
keepConnectionOpen, CatalogNameUsage.ForceName, configSqlServerCatalog);
break;
... rest of switch ...
}
return daToReturn
}
}
Then in the other layers you can:
IDataAccessAdapter adapter = DataAccessAdapterFactory.GetDataAdapter("SQLServer");
adapter.FetchEntity( ... );
We use this construction to support an application that uses multiple Oracle and SQL Server databases (all having the same database structure).