从c#.net中的excel文件中添加组合框项目 [英] to add combo box items from excel file in c#.net

查看:74
本文介绍了从c#.net中的excel文件中添加组合框项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要将项目添加到组合框 从excel文件 。在我的表单中我有1个组合框(对于项目)和1个文本框(对于价格) ).i需要从excel文件中加载项目,并且应根据组合框的值选择文本框的值。



例如:

组合框文本框
项目 价格
aaa 10
bbb 12
ccc 20



像this.help me ....

解决方案

< blockquote>从这里开始:如何使用ADO.NET在Visual Basic .NET的Excel工作簿中检索和修改记录 [ ^ ]

虽然它是VB.NET ,而不是C#,但你会发现如何实现这一点。



C#: ADO.N ET代码示例 [ ^ ]

hi,i need to add the items to combo box from excel file.In my form am having 1 combo box(for items) and 1 textbox (for price).i need to load items to both from excel file and the value of textbox should be selected according to value of combo box.

eg:

combobox    textbox
  Items      Price
  aaa         10
  bbb         12
  ccc         20


like this.help me....

解决方案

Start here: How To Use ADO.NET to Retrieve and Modify Records in an Excel Workbook With Visual Basic .NET[^]
Although it's VB.NET, not C#, but there you'll find an idea how to achieve that.

C#: ADO.NET Code Examples[^]


这篇关于从c#.net中的excel文件中添加组合框项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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