コード例 #1
0
ファイル: Schema.cs プロジェクト: mariusmg/DataBlock
        public static DatabaseColumn[] GetColumnInfo(DatabaseServer server,
                                                     string tableName,
                                                     string connectionString)
        {
            ISchemaLoader loader = null;

            switch (server)
            {
            case DatabaseServer.Access:
                loader = new AccessSchemaLoader();
                return(loader.GetColumnInfo(tableName, connectionString));

            case DatabaseServer.SqlServer:
                loader = new SqlServerSchemaLoader();
                return(loader.GetColumnInfo(tableName, connectionString));

            case DatabaseServer.MySql:
                loader = new MySqlSchemaLoader();
                return(loader.GetColumnInfo(tableName, connectionString));

            case DatabaseServer.PostgreSQL:
                loader = new PostgreSqlSchemaLoader();
                return(loader.GetColumnInfo(tableName, connectionString));


            default:
                throw new Exception();
            }
        }
コード例 #2
0
ファイル: Schema.cs プロジェクト: mariusmg/DataBlock
        /// <summary>
        ///
        /// </summary>
        /// <param name="server"></param>
        /// <param name="connectionString"></param>
        /// <returns></returns>
        public static List <string> GetTableList(DatabaseServer server,
                                                 string connectionString)
        {
            ISchemaLoader loader = null;

            switch (server)
            {
            case DatabaseServer.Access:
                loader = new AccessSchemaLoader();
                return(loader.GetTableList(connectionString));

            case DatabaseServer.SqlServer:
                loader = new SqlServerSchemaLoader();
                return(loader.GetTableList(connectionString));

            case DatabaseServer.MySql:
                loader = new MySqlSchemaLoader();
                return(loader.GetTableList(connectionString));

            case DatabaseServer.PostgreSQL:
                loader = new PostgreSqlSchemaLoader();
                return(loader.GetTableList(connectionString));

            default:
                throw new Exception();
            }
        }