private void cbDBTable_SelectedValueChanged(object sender, EventArgs e) { if (gvMacth.Rows.Count <= 0) { return; } var item = dbList.Where(r => r.DBShowName == cbDBName.SelectedItem.ToString()).FirstOrDefault(); dbo = new DBOperate(item.DBType, item.DBUrl, item.DBName); DataTable dt = dbo.getTableColumnName(cbDBTable.SelectedItem.ToString()).Tables["dbTable"]; MacthName.Items.Add("自增长"); MacthName.Items.Add("自定义"); MacthName.Items.Add("Null"); listColumnName.Clear(); foreach (DataRow dr in dt.Rows) { cbBasis.Items.Add(dr[0].ToString()); MacthName.Items.Add(dr[0].ToString()); listColumnName.Add(dr[0].ToString()); } }
private void cbDBTableG_SelectedValueChanged(object sender, EventArgs e) { var item = dbList.Where(r => r.DBShowName == cbDBNameG.SelectedItem.ToString()).FirstOrDefault(); dbo = new DBOperate(item.DBType, item.DBUrl, item.DBName); DataTable dt = dbo.getTableColumnName(cbDBTableG.SelectedItem.ToString()).Tables["dbTable"]; listColumnGName.Clear(); foreach (DataRow dr in dt.Rows) { listColumnGName.Add(dr[0].ToString()); } }
private void cbDBTableG_SelectedValueChanged(object sender, EventArgs e) { gvMacth.AutoGenerateColumns = false; gvMacth.Rows.Clear(); var item = dbList.Where(r => r.DBShowName == cbDBNameG.SelectedItem.ToString()).FirstOrDefault(); dbo = new DBOperate(item.DBType, item.DBUrl, item.DBName); DataTable dt = dbo.getTableColumnName(cbDBTableG.SelectedItem.ToString()).Tables["dbTable"]; this.gvMacth.DataSource = dt; listColumnGName.Clear(); foreach (DataRow dr in dt.Rows) { listColumnGName.Add(dr[0].ToString()); } }
private void cbDBTable_SelectedValueChanged(object sender, EventArgs e) { var item = dbList.Where(r => r.DBShowName == cbDBName.SelectedItem.ToString()).FirstOrDefault(); dbo = new DBOperate(item.DBType, item.DBUrl, item.DBName); DataTable dt = dbo.getTableColumnName(cbDBTable.SelectedItem.ToString()).Tables["dbTable"]; listColumnName.Clear(); foreach (DataRow dr in dt.Rows) { listColumnName.Add(dr[0].ToString()); } }