내가 VC# 및 ADO SQLite는의 안돼서 ...사용 콤보 상자 값
내가 값에 따라 콤보 상자의 내용을 변경하기 위해 노력하고있어
SQLiteCommand cmd3 = new SQLiteCommand("select distinct(ACTION) from ACTION_LIST where CATEGORY='comboBox1.text'", conn2);
어떤 일을하는 데 사용 :
내 문제가 여기에있다 ... 또 하나의 선물?
private void Form1_Load(object sender, EventArgs e)
{
using (SQLiteConnection conn1 = new SQLiteConnection(@"Data Source = Data\MRIS_DB_MASTER"))
{
conn1.Open();
SQLiteCommand cmd2 = new SQLiteCommand("select distinct(CATEGORY) from ACTION_LIST", conn1);
SQLiteDataAdapter adapter1 = new SQLiteDataAdapter(cmd2);
DataTable tbl1 = new DataTable();
adapter1.Fill(tbl1);
comboBox1.DataSource = tbl1;
comboBox1.DisplayMember = "CATEGORY";
adapter1.Dispose();
cmd2.Dispose();
}
using (SQLiteConnection conn2 = new SQLiteConnection(@"Data Source = Data\MRIS_DB_MASTER"))
{
conn2.Open();
SQLiteCommand cmd3 = new SQLiteCommand("select distinct(ACTION) from ACTION_LIST where CATEGORY='comboBox1.text'", conn2);
SQLiteDataAdapter adapter2 = new SQLiteDataAdapter(cmd3);
DataTable tbl2 = new DataTable();
adapter2.Fill(tbl2);
comboBox2.DataSource = tbl2;
comboBox2.DisplayMember = "ACTION";
adapter2.Dispose();
cmd3.Dispose();
}
}
감사
관련
감사합니다. 원하는대로 작동합니다. 감사합니다. – nicodevil