将数据从Excel工作表导入到记事本中 [英] import data from an Excel sheet into a note pad

查看:373
本文介绍了将数据从Excel工作表导入到记事本中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个任务:-),我被赋予了一个包含6列和2000多个数据行的电子表格(EXCEL),我需要创建一个具有下拉列表的应用程序,以从中选择任意2列或更多列电子表格并将其填充到记事本中进行测试,但直接填充到现有数据库表中进行实时处理?请提出建议..
我已经在我的机器上安装了MS Visual Studio2005.

i have a task :-) , i have been given a spread sheet(EXCEL) with 6 columns and 2000+ data rows , i need to create an application which has a drop down list to select any 2 or more columns from the spreadsheet and populate them into a note pad for testing but directly into an existing database table for real time ? please give suggestions..
i have MS Visual studio 2005 installed in my machine

推荐答案

如果您已获得此任务,则假定提供该任务的人假定您知道该怎么做它.他们为什么要这样假设?假设您需要帮助,为什么有人认为您可以做到,而您似乎甚至不能在要求我们进行基础研究之前进行任何研究?

只要您的代码在计算机上运行,​​Microsoft Office专用工具就可以与Office进行交互.然后,您可以提取所需的数据.

If you''ve been given this task, one assumes that the person giving it assumes you know how to do it. Why do they assume this ? Assuming you need some help, why is it that someone thinks you can do it, and it seems you can''t even do some basic research before asking us to do it ?

THe Microsoft Tools For Office let you interact with Office, so long as it''s present on the machine your code runs on. You can then extract the data you want.

harry2725写道:
harry2725 wrote:

将它们填充到记事本中



这是不可能的.您无法与记事本互动.我认为您的意思是您想导出到文本文件.这很容易做到,只需使用stringbuilder来构建要导出的数据,然后将其保存.



This is impossible. You can''t interact with Notepad. I think you mean you want to export to a text file. That''s easily done, just use a stringbuilder to build up the data you want to export, and save it.

harry2725写道:
harry2725 wrote:

但直接进入现有数据库表以进行实时访问吗?

but directly into an existing database table for real time ?



因此,您可以根据设计时所了解的架构编写ADO.NET代码以将数据推送到数据库中.



So, you write ADO.NET code to push your data into the database, based on the schema that you know about at design time.


我认为这将为您提供帮助:
使用MDAC和Oledb使用MS Excel(xls/xlsx) [
I think this one will help you :
Working with MS Excel(xls / xlsx) Using MDAC and Oledb[^]

:thumbsup:


是的,我正在尝试告诉文本文件...感谢您的建议,请尝试处理该文本文件并获得进一步的帮助
yes i was trying to tell text file ... thanks for the suggestion ill try to work on it and get back for further help


这篇关于将数据从Excel工作表导入到记事本中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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