combobox连接Access 在C#窗体中,combobox怎样才能提取access 中某个字段的值,并显示出来 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 就是绑定的话,都会出现这样的结果,所以我想问看看,是不是我那里没有设置好如图System.Data.DataViewManagerListItemTypeDescriptor 这个值怎样解决 将你的代码贴出来 才能解决 combox 可以直接绑定table conn.Open(); DataSet ds = new DataSet(); string sql = "Select OVERTIME as 时间,MEDINAME as 名称,EPCID as ID号 From hope"; OleDbCommand cmd = new OleDbCommand(sql, conn); OleDbDataAdapter dap = new OleDbDataAdapter(); dap.SelectCommand = cmd; dap.Fill(ds); dataGridView1.DataSource = ds.Tables[0].DefaultView; if (ds.Tables[0].Rows.Count != 0) { comboBox2.DataSource = ds; comboBox2.DisplayMember = "ID号"; comboBox2.ValueMember = "ID号"; conn.Close(); } comboBox2.DisplayMember = "名称"; comboBox2.ValueMember = "ID号"; DataSet ds = new DataSet(); string sql = "Select OVERTIME as 时间,MEDINAME as 名称,EPCID as ID号 From hope"; OleDbCommand cmd = new OleDbCommand(sql, conn); OleDbDataAdapter dap = new OleDbDataAdapter(); dap.SelectCommand = cmd; dap.Fill(ds); conn.Close(); dataGridView1.DataSource = ds.Tables[0].DefaultView; if (ds.Tables[0].Rows.Count != 0) { comboBox2.DataSource = ds; comboBox2.DisplayMember = "名称"; comboBox2.ValueMember = "ID号"; } 还是一样的问题没有用combobox中 填充的是 System.Data.DataViewManagerListItemTypeDescriptor DataSet ds = new DataSet(); string sql = "Select OVERTIME as 时间,MEDINAME as 名称,EPCID as ID号 From hope"; OleDbCommand cmd = new OleDbCommand(sql, conn); OleDbDataAdapter dap = new OleDbDataAdapter(); dap.SelectCommand = cmd; dap.Fill(ds); conn.Close(); dataGridView1.DataSource = ds.Tables[0].DefaultView; if (ds.Tables[0].Rows.Count != 0) { comboBox2.DataSource = ds; comboBox2.DisplayMember = "ID号"; comboBox2.ValueMember = "ID号"; } sqldataadapter 不用打开数据库的 而且使用玩就关闭 不要执行玩所有语句在进行关闭 comboBox2.DataSource =ds.Tables[0].DefaultView 也绑定这个试一下 你是不是 在 combox的change事件里面写了代码了 不管用backergroundworker或者thread都感觉按钮会卡一下,怎么解决? 请教一下关于money这个数据类型的insert问题 webBrowser windowsetwidth问题 SOS~~最后20分问个问题 高分求C#与WORD连接方法! 【跪求】《c#高级编程》英文版电子书 HTTPWebRequest模拟WEB登录,求方法。 多线程 的问题望高手解疑惑 再c#下面,有没有缺省值呢? 在DataSet里如何找数据? 用正则表达式提取html中的一个指定div对! 有懂.NET MVC3的吗,遇到一些奇怪的问题,请教高手
如图System.Data.DataViewManagerListItemTypeDescriptor 这个值
怎样解决
DataSet ds = new DataSet();
string sql = "Select OVERTIME as 时间,MEDINAME as 名称,EPCID as ID号 From hope";
OleDbCommand cmd = new OleDbCommand(sql, conn);
OleDbDataAdapter dap = new OleDbDataAdapter();
dap.SelectCommand = cmd;
dap.Fill(ds);
dataGridView1.DataSource = ds.Tables[0].DefaultView; if (ds.Tables[0].Rows.Count != 0)
{
comboBox2.DataSource = ds;
comboBox2.DisplayMember = "ID号";
comboBox2.ValueMember = "ID号";
conn.Close();
}
comboBox2.ValueMember = "ID号";
DataSet ds = new DataSet();
string sql = "Select OVERTIME as 时间,MEDINAME as 名称,EPCID as ID号 From hope";
OleDbCommand cmd = new OleDbCommand(sql, conn);
OleDbDataAdapter dap = new OleDbDataAdapter();
dap.SelectCommand = cmd;
dap.Fill(ds);
conn.Close();
dataGridView1.DataSource = ds.Tables[0].DefaultView; if (ds.Tables[0].Rows.Count != 0)
{
comboBox2.DataSource = ds;
comboBox2.DisplayMember = "名称";
comboBox2.ValueMember = "ID号"; }
没有用
combobox中 填充的是 System.Data.DataViewManagerListItemTypeDescriptor
DataSet ds = new DataSet();
string sql = "Select OVERTIME as 时间,MEDINAME as 名称,EPCID as ID号 From hope";
OleDbCommand cmd = new OleDbCommand(sql, conn);
OleDbDataAdapter dap = new OleDbDataAdapter();
dap.SelectCommand = cmd;
dap.Fill(ds);
conn.Close();
dataGridView1.DataSource = ds.Tables[0].DefaultView; if (ds.Tables[0].Rows.Count != 0)
{
comboBox2.DataSource = ds;
comboBox2.DisplayMember = "ID号";
comboBox2.ValueMember = "ID号"; }
sqldataadapter 不用打开数据库的 而且使用玩就关闭 不要执行玩所有语句在进行关闭