GetProvider() public méthode

public GetProvider ( string dbmsType ) : DatabaseProvider
dbmsType string
Résultat DatabaseProvider
Exemple #1
0
        public IDbConnection CreateConnection()
        {
            DatabaseProvider provider = providers.GetProvider(dbms);

            if (provider == null)
            {
                throw new ArgumentException("Supported dbms: ora, mssql, mysql.");
            }

            Assembly assembly = Assembly.Load(provider.AssemblyName);
            Type     type     = assembly.GetType(provider.ConnectionClass);

            return((IDbConnection)Activator.CreateInstance(type, connectionString));
        }
 public void TestCanLoadMsSqlProvider()
 {
     Assert.IsNotNull(providers.GetProvider("mssql"));
 }