/// <summary> /// Builds the DatabaseSchema for a specified database /// </summary> /// <param name="connectionString">The OleDb connection to use</param> /// <param name="providerType">The DbProviderType to set the DatabaseSchema to</param> /// <returns></returns> public static DatabaseSchema CreateDatabaseSchema(string connectionString, Adapdev.Data.DbType databaseType, DbProviderType providerType, string schemaFilter, Adapdev.IProgressCallback progress) { int recordCount = 0; _callback = progress as Adapdev.IProgressCallback; if (_callback != null) { _callback.SetText("Obtaining Schema Details",""); _callback.SetAutoClose(ProgressAutoCloseTypes.WaitOnError); } DatabaseSchema ds = null; switch(providerType) { case DbProviderType.OLEDB: case DbProviderType.SQLSERVER: case DbProviderType.ORACLE: ds = new OleDbSchemaBuilder(_callback, ref recordCount).BuildDatabaseSchema(connectionString, databaseType, providerType, schemaFilter); break; // case DbProviderType.MYSQL: // ds = new MySqlSchemaBuilder(_callback, ref recordCount).BuildDatabaseSchema(connectionString, databaseType, providerType, schemaFilter); // break; } return ds; }
public OleDbSchemaBuilder(Adapdev.IProgressCallback callback, ref int recordCount) { this._callback = callback; this.recordCount = recordCount; }