110,502
社区成员
发帖
与我相关
我的任务
分享
DataTable dt=new DataTable();
//然后某个DataSet.Fill(dt);dt就成了某张表
combobox.datasource=dt;
//绑定数据源之后将要显示的列绑定至combobox
combobox.DisplayMember="列名";
//如果有必要也可绑定数值成员
combobox.ValueMember="列名";
OleDbCommand odCommand = odcConnection.CreateCommand();
odCommand.CommandText = "select Alias from Data where Alias='" + alias+ "'";
OleDbDataReader odrReader = odCommand.ExecuteReader();
if (odrReader.Read())
{
combox.Item.Add(odrReader.GetVaule(0));//dosomething
}
odrReader.Close();