private void Form3_Load(object sender, EventArgs e) { this.Text = string.Format(Tag.ToString(), table); string s_sql = AppFunc.GetSql(conStr, 3, table); dataGridView1.DataSource = AppFunc.GetData(conStr, s_sql); }
void LoadDb() { treeView1.Nodes.Clear(); string s_table = AppFunc.GetSql(conStr, 1); string s_view = AppFunc.GetSql(conStr, 2); DataTable table1 = AppFunc.GetData(conStr, s_table); DataTable table2 = AppFunc.GetData(conStr, s_view); TreeNode rootNode = new TreeNode(conStr.Database); var nodes = treeView1.Nodes.Find(conStr.Database, false); if (nodes != null && nodes.Length > 0) { rootNode = nodes[0]; } else { treeView1.Nodes.Add(rootNode); } SetTreeview(1, rootNode, table1); SetTreeview(2, rootNode, table2); }