public static DbConnection Connect(string configuration) { string connectionString = null; string connectionProvider = null; ExtractConnectionStringInfo(configuration, out connectionProvider, out connectionString); var factory = DataExtensions.GetFactory(connectionProvider); OptimizeConnectionString(factory, ref connectionString); var connection = factory.CreateConnection(); connection.ConnectionString = connectionString; connection.Open(); OptimizeConnection(connection); return(connection); }