예제 #1
0
        protected override void PopulateTables(DbObjectCollection <Table> tablesCollection)
        {
            var tables = Connection.GetSchema("Tables", new[] { null, Connection.Database });

            foreach (DataRow row in tables.Rows)
            {
                if ((string)row["TABLE_TYPE"] == "BASE TABLE")
                {
                    var table = new MySqlTable(this)
                    {
                        Name = row["TABLE_NAME"].ToString()
                    };
                    tablesCollection.Add(table);
                }
            }

            var views = Connection.GetSchema("Views", new[] { null, Connection.Database });

            foreach (DataRow row in views.Rows)
            {
                var table = new MySqlTable(this)
                {
                    Name = row["TABLE_NAME"].ToString()
                };
                table.SetView(true);
                tablesCollection.Add(table);
            }
        }
예제 #2
0
        protected override void PopulateTables(DbObjectCollection <Table> tablesCollection)
        {
            var tables = this.Connection.GetSchema("Tables", new string[] { null, this.connection.Database });

            foreach (DataRow row in tables.Rows)
            {
                var table = new MySqlTable(this);
                table.Name = row["TABLE_NAME"].ToString();
                tablesCollection.Add(table);
            }

            var views = this.Connection.GetSchema("Views", new string[] { null, this.connection.Database });

            foreach (DataRow row in views.Rows)
            {
                var table = new MySqlTable(this);
                table.Name = row["TABLE_NAME"].ToString();
                table.SetView(true);
                tablesCollection.Add(table);
            }
        }