在Excel.net中将Excel工作表数据加载到SQL Server# [英] Loading Excel sheet data to Sql Server in asp.net c#

查看:70
本文介绍了在Excel.net中将Excel工作表数据加载到SQL Server#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试在ASP中使用C#将数据从excel导入到SQL Server。净。我必须提供客户端选项来浏览和上传Excel文件数据到Sql server表。我没有生产Web服务器的写权限,其中应用程序将托管在IIS服务器上。所以,我不能使用FileUpload,其中excel表将首先保存在Server Path中,然后使用BulkReader。请告诉我任何替代方法来实现这一点。谢谢!

Am trying to Import Data from excel to Sql server using C# in ASP. NET. I have to give client side options to browse and upload excel file data to Sql server tables.I don't have write permission on Production Web Server, where the Application will be hosted on IIS Server. So, I cannot use FileUpload where excel sheet will be first saved in in Server Path and then use BulkReader.Please suggest me any alternative way to achieve this. Thanks!

推荐答案

没有批量上传的更慢的解决方案 - 循环数据,构建插入查询和插入数据。
Slower solution without bulk upload - loop through data, build insert queries and insert data.


存储数据到来自excel的数据表然后使用批量插入上传到sqlserver。

点击链接:

http://jubayerdevs.blogspot.hk/2013/10/store-excel-data-to-datatable-and-copy.html [ ^ ]
store data to datatable from excel then upload to sqlserver using bulk insert.
follow the link:
http://jubayerdevs.blogspot.hk/2013/10/store-excel-data-to-datatable-and-copy.html[^]


在这里阅读:

http://technet.microsoft.com/en-us/library/ms345167.aspx [ ^ ]

和这里:

http://blogs.msdn.com/b/mattm/archive/2008/12/30/samples-for-creating-ssis-packages-programmatically.aspx [ ^ ]
Read here:
http://technet.microsoft.com/en-us/library/ms345167.aspx[^]
and here:
http://blogs.msdn.com/b/mattm/archive/2008/12/30/samples-for-creating-ssis-packages-programmatically.aspx[^]


这篇关于在Excel.net中将Excel工作表数据加载到SQL Server#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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