예제 #1
0
파일: SqlMaker.cs 프로젝트: fjiang2/sqlcon
        public override SqlColumnValuePair Add(string name, object value)
        {
            var pair = base.Add(name, value);

            pair.Field.Primary  = PrimaryKeys != null && PrimaryKeys.Contains(name);
            pair.Field.Identity = IdentityKeys != null && IdentityKeys.Contains(name);

            return(pair);
        }
예제 #2
0
        public DataTableDpoClass(DataTable table)
        {
            DatabaseName dname = new DatabaseName(ConnectionProviderManager.DefaultProvider, "MEM");

            this.table = table;

            this.tableName = new ClassTableName(new TableName(dname, TableName.dbo, table.TableName));

            this._columns = new ColumnCollection(this);
            foreach (DataColumn c in table.Columns)
            {
                this._columns.Add(new DtColumn(c));
            }

            this._identity = new IdentityKeys(this._columns);
            this._computedColumns = new ComputedColumns(this._columns);

            this._columns.UpdatePrimary(this.PrimaryKeys);
            this._columns.UpdateForeign(this.ForeignKeys);
        }
예제 #3
0
파일: MetaTable.cs 프로젝트: fjiang2/sqlcon
        protected virtual void LoadSchema()
        {
            DataTable schema = InformationSchema.TableSchema(tableName);

            this._columns = new ColumnCollection(this);

            foreach (DataRow row in schema.Rows)
            {
                this._columns.Add(new MetaColumn(row));
            }

            this._identity = new IdentityKeys(this._columns);
            this._computedColumns = new ComputedColumns(this._columns);

            this._columns.UpdatePrimary(this.PrimaryKeys);
            this._columns.UpdateForeign(this.ForeignKeys);
        }
예제 #4
0
 public static DataColumn[] IdentityKeys(this DataTable dt, IdentityKeys keys)
 {
     return(GetDataColumns(dt, keys.ColumnNames));
 }