/// <summary> /// テーブル情報を設定します。 /// </summary> /// <param name="database">データベース</param> private void SetTables(Smo.Database database) { _tables = new Dictionary <string, Entity.Table>(); foreach (Smo.Table source in database.Tables) { Entity.Table destination = new Entity.Table(); destination.Name = source.Name; destination.ExtendeProperties.ReplaceStringIfNotContains = string.Empty; this.SetExtendedProperties(source.ExtendedProperties, destination.ExtendeProperties); _tables.Add(destination.Name, destination); } }
public List <Entity.Table> getListTable() { List <Entity.Table> lst = new List <Entity.Table>(); String sql = "select * from tblBan"; DataTable dt = conn.getTable(sql); Debug.WriteLine(dt.Rows.Count); foreach (DataRow item in dt.Rows) { Entity.Table tb = new Entity.Table( item["iId"].ToString(), item["sName"].ToString(), getStatus(item["sStatus"].ToString()) ); lst.Add(tb); } return(lst); }
private void SetColumns(Smo.Table table) { Entity.Table destination = _tables[table.Name]; foreach (Smo.Column item in table.Columns) { Entity.Column col = new Entity.Column(); destination.Columns.Add(item.Name, col); col.Name = item.Name; col.IsPrimaryKey = item.InPrimaryKey; col.Nullable = item.Nullable; col.DataType.Name = item.DataType.Name; col.DataType.MaximumLength = item.DataType.MaximumLength; col.DataType.NumericPrecision = item.DataType.NumericPrecision; col.DataType.NumericScale = item.DataType.NumericScale; col.DataType.IsIdentity = item.Identity; col.DataType.IdentitySeed = item.IdentitySeed; col.DataType.IdentityIncrement = item.IdentityIncrement; col.ExtendeProperties.ReplaceStringIfNotContains = string.Empty; this.SetExtendedProperties(item.ExtendedProperties, col.ExtendeProperties); } }