protected override Table CreateTable(Database database, DataRow row) { Table table = new Table(); table.ParentDatabase = database; table.Name = row["tablename"].ToString(); return table; }
protected internal TableCollection GetTables(Database database) { TableCollection tables = new TableCollection(); DataAccessProviderFactory dataAccessProviderFactory = new DataAccessProviderFactory(Server.ProviderType); IDbConnection connection = dataAccessProviderFactory.CreateConnection(Server.ConnectionString); if(connection.State == ConnectionState.Closed) { connection.Open(); } connection.ChangeDatabase(database.Name); DataSet ds; if (Server.ProviderType != DataProviderType.Oracle) { connection.ChangeDatabase(database.Name); ds = TableSchema(dataAccessProviderFactory, connection); } else { ds = TableSchema(dataAccessProviderFactory, connection, database); } connection.Close(); /* Changed by Ferhat */ if (ds.Tables.Count > 0) { foreach (DataRow row in ds.Tables[0].Rows) { tables.Add(CreateTable(database, row)); } } return tables; }
protected override Table CreateTable(Database database, DataRow row) { var table = new Table(); table.ParentDatabase = database; table.Name = row["tablename"].ToString(); table.Schema = string.Empty; return table; }
protected override Table CreateTable(Database database, DataRow row) { var table = new Table { ParentDatabase = database, Schema = row["SCHEMA"].ToString(), Name = row["NAME"].ToString() }; return table; }
protected override DataSet TableSchema(DataAccessProviderFactory dataProvider, IDbConnection connection, Database database) { var ds = new DataSet(); var sqlString = dataProvider.CreateCommand("SELECT OWNER, TABLE_NAME FROM all_tables where OWNER = '" + database.Name + "'",connection); sqlString.CommandType = CommandType.Text; var da = dataProvider.CreateDataAdapter(); da.SelectCommand = sqlString; da.Fill(ds); return ds; }
/* Add by Ferhat */ protected internal TableCollection GetViews(Database database) { var tables = new TableCollection(); var dataAccessProviderFactory = new DataAccessProviderFactory(Server.ProviderType); var connection = dataAccessProviderFactory.CreateConnection(Server.ConnectionString); if (connection.State == ConnectionState.Closed) { connection.Open(); } connection.ChangeDatabase(database.Name); var ds = ViewSchema(dataAccessProviderFactory, connection); connection.Close(); if (ds.Tables.Count > 0) { foreach (DataRow row in ds.Tables[0].Rows) { tables.Add(CreateTable(database, row)); } } return tables; }
protected virtual DataSet TableSchema(DataAccessProviderFactory dataAccessProvider,IDbConnection connection, Database database) { throw new NotImplementedException(); }
protected abstract Table CreateTable(Database database, DataRow row);
public bool Contains(Database database) { return List.Contains(database); }
public void Remove(Database database) { List.Remove(database); }
public int IndexOf(Database database) { return List.IndexOf(database); }
public void Add(Database database) { List.Add(database); }
protected override Database CreateDatabase(DataRow row, DatabaseCollection databases) { Database db = new Database(); db.Name = row["DATABASE_NAME"].ToString(); return db; }
public DatabaseEventArgs(Database database) { _database = database; }