Ejemplo n.º 1
0
        public static Boolean CanConnectToDatabase(DatabaseServer server, String connectionString)
        {
            switch (server)
            {
            case DatabaseServer.SqlServer:
            {
                var cn = new SqlServerDatabase(connectionString);
                return(cn.CanOpen());
            }

            case DatabaseServer.MySql:
            {
                var cn = new MySqlDatabase(connectionString);
                return(cn.CanOpen());
            }

            case DatabaseServer.Oracle:
            case DatabaseServer.PostgreSql: throw new NotImplementedException();

            default: throw new NotImplementedException();
            }
        }