internal void SetTable(Table table) { if (this.table != null) throw new InvalidOperationException(string.Format("Column '{0}' is associated to Table '{1}'", this.name, this.table.Name)); this.table = table; }
public void SetUpTable() { this.engine = new Engine(); this.database = this.engine.CreateDatabase("Sales"); this.table = database.CreateTable("Employees"); this.table.AddColumn(new Column("FirstName")); this.table.AddColumn(new Column("LastName")); this.table.AddRow(new object[] { "John", "Smith" }); this.table.AddRow(new object[] { "Adam", "Jones" }); this.table.AddRow(new object[] { "Alice", "Stuart" }); }
public Table CreateTable(string name) { if (this.tables.ContainsKey(name)) throw new InvalidOperationException(string.Format("Table '{0}' already exists", name)); Table table = new Table(this, name); this.tables[name] = table; return table; }
public void SetUpTable() { Engine engine = new Engine(); Database database = engine.CreateDatabase("Sales"); this.table = database.CreateTable("Customers"); this.table.AddColumn(new Column("FirstName")); this.table.AddColumn(new Column("LastName")); }
public void SetUpTable() { Engine engine = new Engine(); Database database = engine.CreateDatabase("Northwind"); this.table = database.CreateTable("Employees"); this.table.AddColumn(new Column("FirstName")); this.table.AddColumn(new Column("LastName")); this.table.AddColumn(new Column("DepartmentID")); this.table.AddColumn(new Column("Address")); for (int k = 1; k <= 100; k++) this.table.AddRow(new object[] { "John " + k, "Doe " + k, (k%10) + 1, (k%2)==0 ? null : "Address " + k}); }