时间:2021-07-01 10:21:17 帮助过:14人阅读
private void test_Load(object sender, EventArgs e) { using (SQLiteConnection con = new SQLiteConnection(Constants.DATA_SOURCE)) { con.Open(); using (SQLiteCommand cmd = new SQLiteCommand()) { cmd.Connection = con; cmd.CommandText = string.Format("select t.org_short_name from sys_orgtable t "); int rows = cmd.ExecuteNonQuery(); SQLiteDataAdapter sda = new SQLiteDataAdapter(cmd); DataTable dt = new DataTable(); sda.Fill(dt); comboBox1.DataSource = dt; comboBox1.DisplayMember = "org_short_name"; } } }
三、结果
参考:
https://zhidao.baidu.com/question/242563101.html?qbl=relate_question_2&word=c%20combobox%BC%D3%D4%D8%CA%FD%BE%DD&skiptype=2
C#winfor实现把数据库的信息显示在comboBox上
标签:data img win str query word color splay https