|
checkedListBox绑定数据库的代码
class DBcon
{
public string strSQL;
public string connectionString;
public SqlConnection myConnction;
public SqlCommandBuilder sqlCmdBld;
public DataSet ds = new DataSet();
public SqlDataAdapter da;
}
private void checkedListBox1_SelectedIndexChanged(object sender, EventArgs e)
{
DBcon db = new DBcon();
this.checkedListBox1.DataSource = db.ds.Tables["point"];
this.checkedListBox1.ValueMember = listBox1.ValueMember;
this.checkedListBox1.DisplayMember = "pname";
}
最近才用C#和数据库,很多地方查了好多还是很茫然。
那个怎么能在checkedListBox控件中显示出point表中需要显示的字段。是listBox1中选定科目,checkedListBox中显示该科目的知识点~
{:soso_e154:}求助,谢谢大家啦。 |
|