void loadTables() { clearQuery(); treeView1.Nodes.Clear(); TableNode nd, ndSub; int n, i; DatabaseTable[] subTables; for (n = 0; n < schema.TableCount; n++) { nd = new TableNode(); nd.table = schema.GetTable(n); nd.Text = nd.table.ToString(); subTables = schema.GetChildTables(n); treeView1.Nodes.Add(nd); if (subTables != null) { for (i = 0; i < subTables.Length; i++) { ndSub = new TableNode(); ndSub.table = subTables[i]; ndSub.Text = subTables[i].ToString(); nd.Nodes.Add(ndSub); } } } }