private void FrmNormalView_Load(object sender, EventArgs e) { IGetAttribute attri = _object as IGetAttribute; if (attri != null) { this.dgvNormal.DataSource = NameAliasValue.ToDataTable(attri.GetAttributes()); } ICreateSql creatsql = _object as ICreateSql; if (creatsql != null) { CreateSqlDelegate action = MyDbHelper.GetCreateSqlFunction(creatsql, _dbClass.GetClassDbType()); if (action != null) { List <CreateSqlObject> csos = action(_dbClass.GetCurrentTableSpaceName()); tbSql.Text = CreateSqlObject.ToCollectionSqls(csos); } } }
private void LoadSql() { StringBuilder sb = new StringBuilder(); sb.AppendLine(CreateSqlObject.ToCollectionSqls(MyDbHelper.GetCreateSqlFunction(_table, _dbClass.GetClassDbType())(null))); List <IConstraintClass> ccs = _dbClass.GetConstraints(_table.TableName); foreach (IConstraintClass item in ccs) { sb.AppendLine(CreateSqlObject.ToCollectionSqls( MyDbHelper.GetCreateSqlFunction(item, _dbClass.GetClassDbType())(null) )); } List <IIndexClass> ics = _dbClass.GetIndexs(_table.TableName); foreach (IIndexClass item in ics) { sb.AppendLine(CreateSqlObject.ToCollectionSqls( MyDbHelper.GetCreateSqlFunction(item, _dbClass.GetClassDbType())(null) )); } tbSql.Text = sb.ToString().TrimEnd('\r', '\n'); }