Exemple #1
0
        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" });
 }
Exemple #3
0
        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;
        }
Exemple #4
0
 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"));
 }
Exemple #5
0
        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});
        }