示例#1
0
文件: Column.cs 项目: ajlopez/AjBase
        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;
        }
示例#2
0
 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" });
 }
示例#3
0
文件: Schema.cs 项目: ajlopez/AjBase
        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;
        }
示例#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"));
 }
示例#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});
        }