数据绑定以窗口形式提供“System.Data.DataRowView”而不是实际值 [英] Databinding gives “System.Data.DataRowView” instead of actual values in window form

查看:80
本文介绍了数据绑定以窗口形式提供“System.Data.DataRowView”而不是实际值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何将一列数据库绑定到windows窗体应用程序中的列表框控件............并且主要的一点是,在复制所有项目时阻止System.Data.DataRowView错误一个列表框到另一个列表框...

how to bind a column of database to list box control in windows form application............and the main point is that, that prevent to System.Data.DataRowView Error when copying all items of one list box to another list box...

推荐答案

不确定你在做什么但是应该这样做:

Not sure what were you doing but following should do:
private void BindComboBox()
{
  comboBox1.DataSource = dataSet1.Tables["Suppliers"];
  comboBox1.DisplayMember = "ProductName";
}



详细信息: MSDN:如何:将Windows窗体ComboBox或ListBox控件绑定到数据 [ ^ ]


这篇关于数据绑定以窗口形式提供“System.Data.DataRowView”而不是实际值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆