问高手们:combobox中数据库的绑定!
我的程序代码是下面这样的:string connString = @"Data Source=.\sqlexpress;Initial Catalog=S_C_A;Integrated Security=True;Pooling=False";
SqlConnection conn = new SqlConnection(connString);
SqlCommand cmd = conn.CreateCommand();
string sql = "select * from class ";
= sql;
SqlDataAdapter adapter = new SqlDataAdapter(sql, conn);
DataTable table = new DataTable();
comboBox1.DataSource = table;
adapter.Fill(table);
comboBox1.DisplayMember = "classname";
comboBox1.ValueMember = "ClassID";
出不来我想要的结果。请问我错在哪里!