Example #1
0
        public Dictionary <String, List <String> > GetTableEntities(DataSet allColumnsSchemaTable)
        {
            Dictionary <String, List <String> > _tables = new Dictionary <string, List <string> >();

            foreach (DataTable dt in allColumnsSchemaTable.Tables)
            {
                if (DbSchema.GetTableType(dt) == TableType.Table)
                {
                    _tables.Add(dt.TableName, AddDataColumns(dt));
                }
            }
            return(_tables);
        }
        public static void UpdateTable(string connString, string dbName)
        {
            var schema = new DbSchema(connString);
            _builder = new BuilderBL.SQLDesigner.QueryBuilder(schema);

            var newGroup = new Group { Name = dbName, SubGroups = new List<Group>(), Entries = new List<Entry>() };

            if (schema != null)
            {
                foreach (var dt in schema.GetTableEntities(schema))
                {
                    var temp = new Group { Name = dt.Key, SubGroups = new List<Group>(), Entries = new List<Entry>() };
                    foreach (var entry in dt.Value)
                    {
                        temp.Entries.Add(new Entry() { Name = entry, Parent = dt.Key });
                    }
                    newGroup.SubGroups.Add(temp);
                }
                MainWindowData.UserConnections.Add(newGroup);
            }
        }