如何从多个Excel工作表导入数据? [英] How to import data from multiple excel sheet?

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

问题描述

如何将数据从网络上多台PC上的多个Excel工作表导入到sql server 2000或2005中的一个表中
使用C#并且没有使用C#?

感谢

How to Import data from multiple excel sheet on multiple PC on the network to one table in sql server 2000 or 2005
using C# and without also?

Thanks

推荐答案

我用Google搜索从excel更新sql数据库",结果得出了630万以上的结果.乍一看似乎很适用,但是由于我对解决方案没有情感上的兴趣,因此我将把它留给您精干的手,以筛选google提出的可能性,并找到适合您要求的答案.
I googled "update sql database from excel", and it came up with over 6.3 million results. The very frist one looks like it might be applicable, but since I have no emotional interest in the solution, I''ll leave it to your capable hands to sift through the possibilities presented by google and find the answer that fits your requirements.


^ ]

http://sqlwithmanoj.wordpress.com/2011/02/16 /import-excel-sheet-with-multiple-recordsets/ [ http: //www.techrepublic.com/blog/datacenter/how-to-import-an-excel-file-into-sql-server-2005-using-integration-services/205 [
http://biresort.net/blogs/pedrocgd/archive/2009/08/06/stepbystep-ssis-extract-data-from-multiple-excel-worksheets.aspx[^]

http://sqlwithmanoj.wordpress.com/2011/02/16/import-excel-sheet-with-multiple-recordsets/[^]

http://www.techrepublic.com/blog/datacenter/how-to-import-an-excel-file-into-sql-server-2005-using-integration-services/205[^]


我会将数据另存为Excel中以竖线(|)分隔的CSV文件.要将分隔符从,"更改为"|",请转到开始"-区域和语言选项"->自定义",然后将列表分隔符"更改为"|".
当您将文件另存为CSV时,它们实际上是文本管道分隔的文件.使用C#阅读这些文件

我建议您对要处理的每个文件进行一些文件验证.然后逐行读取每个文件,并使用string.split()方法获取数据元素.

将数据插入数据集中,然后进行更新.
I would save the data as pipe(|) delimited CSV files in Excel. To change the delimiter from "," to "|", go to Start--Regional and Language Options-->Customise and change List separator to "|".
When you save the files as CSV they are actually text pipe delimited files. Read these files using C#

I suggest you do some file validation on every file that you''re going to process. Then read each file, line by line and use the string.split() method to get the data elements.

Insert the data into dataset and then update.


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

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