如何在windows application.along中的组合框中添加默认值--select--并添加数据源。 [英] How to add default value --select-- in combobox in windows application.along with adding datasource.

查看:66
本文介绍了如何在windows application.along中的组合框中添加默认值--select--并添加数据源。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

hI

我必须将excel数据上传到mysql数据库抛出Windows窗体应用程序。我把comboboexs用来访问excel表的列名。

i将所有列绑定到所有组合框但是我需要在组合框列表的开头插入--select--

combobox1.DataSource = dt;

combobox1.ValueMember = ORDINAL_POSITION;

combobox1.DisplayMember = COLUMN_NAME;

combobox1.BindingContext = new BindingContext() ;





up up它很好,但我想在列表的开头插入--select--

i添加它

combobox.Items.Insert(0,new ListItem(Select,0));



但它显示的错误就像你分配数据源一样,你不能改变数据。





如何解决问题。

请告诉我。

解决方案





如何使用for循环填充组合框中的年份 [ ^ ]





http://forums.asp.net/t/1232340 .aspx / 1 [ ^ ]

hI
I have to upload excel data to mysql database throw windows forms application. i put comboboexs to access column names of excel sheet.
i bind all columns to the all comboboxes but i need to insert --select-- in starting of combobox list.
combobox1.DataSource = dt;
combobox1.ValueMember = ORDINAL_POSITION;
combobox1.DisplayMember =COLUMN_NAME;
combobox1.BindingContext = new BindingContext();


up tothis it is fine but i wonts to insert --select-- in starting of list.
i added it by
combobox.Items.Insert(0, new ListItem("Select", "0"));

but it showing error like this u cannot change data once u assign datasource.


how to solve the problem.
please tell me.

解决方案

Hi,

how to fill year in combobox with using for loop[^]


http://forums.asp.net/t/1232340.aspx/1[^]


这篇关于如何在windows application.along中的组合框中添加默认值--select--并添加数据源。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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