public virtual TableInfo AddTable(string tableName, string desc = null, bool shouldDescOnly = false) { if (string.IsNullOrWhiteSpace(tableName)) { return(null); } TableInfo fir = CurrentTables.FirstOrDefault(d => d.Name == tableName); if (fir != null) { CurrentTables.Remove(fir); CurrentTables.Insert(0, fir); return(fir); } var table = new TableInfo(tableName, this) { Description = desc }; CurrentTables.Insert(1, table); TableNames.SetSource(CurrentTables); return(table); }
public override List <TableInfo> RefreshTableNames() { var item = CurrentTables.ToList(); TableNames.SetSource(item); return(item); }
public override List <TableInfo> RefreshTableNames() { var table = GetDataTable("select name from sysobjects where xtype='u'"); var names = (from DataRow dr1 in table.Rows select new TableInfo(dr1.ItemArray[0].ToString(), this)).ToList(); TableNames.SetSource(names); return(names); }
public virtual List <TableInfo> RefreshTableNames() { DataTable items = GetDataTable("show tables"); List <TableInfo> res = (from DataRow dr in items.Rows select new TableInfo(dr.ItemArray[0].ToString(), this)).ToList(); TableNames.SetSource(res); return(res); }
public override List <TableInfo> RefreshTableNames() { var items = GetDataTable("select name from sqlite_master where type='table' order by name"); List <TableInfo> res = new List <TableInfo>(); foreach (DataRow dr in items.Rows) { res.Add(new TableInfo(dr.ItemArray[0].ToString(), this)); } TableNames.SetSource(res); return(res); }
public override List <TableInfo> RefreshTableNames() { var items = GetDataTable("select name from sqlite_master where type='table' order by name"); var res = new List <TableInfo>(); foreach (DataRow dr in items.Rows) { var name = dr.ItemArray[0].ToString(); var size = GetDataTable($"select count(*) from {name}").Rows[0].ItemArray[0]; res.Add(new TableInfo(name, this) { Size = int.Parse(size.ToString()) }); } TableNames.SetSource(res); return(res); }
public override List <TableInfo> RefreshTableNames() { if (IsUseable == false) { return(new List <TableInfo>()); } var dbComm = new MySqlCommand("show tables", dbConn); List <TableInfo> res = new List <TableInfo>(); Execute("show tables", d => res.Add(new TableInfo(d.GetValue(0).ToString(), this))); TableNames.SetSource(res); // res.Execute(GetTableInfo); return(res); }
public override List <TableInfo> RefreshTableNames() { if (IsUseable == false || DB == null) { return(new List <TableInfo>()); } List <TableInfo> collectionNames = (from d in DB.GetCollectionNames() where d != null let m = d.Split('.') where m.Length == 2 let index = DB.GetCollection(m[1]).Metadata.Indexes.Keys.ToList() let count = DB.GetCollection(m[1]).Count() select new TableInfo(m[1], this) { Size = (int)count, ColumnInfos = index.Select(name => new ColumnInfo(name)).ToList() }).ToList(); TableNames.SetSource(collectionNames); return(collectionNames); }