public DefaultTable GetTableAsDefault(string tableName) { tableName = tableName.ToUpper(); if (!SchemaManager.SchemaDictionary.ContainsKey(tableName)) { MultipleSchemas schemas = this.LoadSchemas(tableName); SchemaManager.SchemaDictionary.Add(tableName, schemas); } return(SchemaManager.SchemaDictionary[tableName]["DEFAULT"].Clone() as DefaultTable); }
public RelationalTable GetTableAsRelational(string tableName) { tableName = tableName.ToUpper(); if (!SchemaManager.SchemaDictionary.ContainsKey(tableName)) { MultipleSchemas schemas = this.LoadSchemas(tableName); SchemaManager.SchemaDictionary.Add(tableName, schemas); } return(SchemaManager.SchemaDictionary[tableName]["RELATIONAL"].Clone() as RelationalTable); }
public MasterTable GetTableAsMaster(string tableName) { tableName = tableName.ToUpper(); if (!SchemaManager.SchemaDictionary.ContainsKey(tableName)) { MultipleSchemas schemas = this.LoadSchemas(tableName); SchemaManager.SchemaDictionary.Add(tableName, schemas); } return(SchemaManager.SchemaDictionary[tableName]["MASTER"].Clone() as MasterTable); }
private MultipleSchemas LoadSchemas(string tableName) { string queries = "SELECT TOP 0 * FROM [" + tableName + "];\n"; SqlCommand command = new SqlCommand(queries); SqlDataReader reader = (SqlDataReader)this.Database.ExecuteReader(command); MasterTable masterTable = new MasterTable(tableName); DefaultTable defaultTable = new DefaultTable(tableName); RelationalTable relationalTable = new RelationalTable(tableName); masterTable.Load(reader); defaultTable.Load(masterTable.CreateDataReader()); relationalTable.Load(masterTable.CreateDataReader()); MultipleSchemas schemas = new MultipleSchemas(); schemas.Add("MASTER", masterTable); schemas.Add("DEFAULT", defaultTable); schemas.Add("RELATIONAL", relationalTable); return(schemas); }