//데이터를 가져와서 그리드에 보여준다. private void ShowData() { string query = ""; TextBox txtCrtl = new TextBox(); DataGridView dgv = new DataGridView(); txtCrtl = FindTextboxInTab(tabControl1.SelectedIndex); dgv = FindDgvInTab(tabControl1.SelectedIndex); if (txtCrtl.SelectedText.Trim() == "") { query = FindSelectQuery(txtCrtl.Text, txtCrtl.SelectionStart); } else { query = txtCrtl.SelectedText.Trim(); } con = new DBCon(query); con.DBFillData(dgv); //System.Windows.Forms.MessageBox.Show(con.pkCnt.ToString()); }