Using common interfaces to abstract away vendor specific classes

suggest change
var providerName = "System.Data.SqlClient";    //Oracle.ManagedDataAccess.Client, IBM.Data.DB2
var connectionString = "{your-connection-string}";
//you will probably get the above two values in the ConnectionStringSettings object from .config file

var factory = DbProviderFactories.GetFactory(providerName);
using(var connection = factory.CreateConnection()) {    //IDbConnection
    connection.ConnectionString = connectionString;
    using(var command = connection.CreateCommand()) {    //IDbCommand
        command.CommandText = "{query}";
        using(var reader = command.ExecuteReader()) {    //IDataReader
            while(reader.Read()) {

Feedback about page:

Optional: your email if you want me to get back to you:

Table Of Contents