In .NET if my DB is SQL Server then in datalayer we have statements SQLConnection, SQLCommand, SQLDataReader…
Suppose we change the DB to oracle then we need to change the statements to OracleConnection, OracleCommand, OracleDataReader and so on everywhere.
Instead how can I have some generic method so that at runtime based on DB type I will call the respective methods.
This is the reason why Microsoft implemented database agnostic interfaces in the
System.Datanamespace. You would be well advised to take a look atIDbConnection, IDbCommand, IDataReader, IDbDataParameterand other that encapsulate the basic functionality and yet allow you to support multiple database systems.