问题描述
我正在开发Web应用程序,该应用程序将使用asp.net c#中的FileUpload控件获取excel文件.现在,当单击提交按钮时,我想将excel数据插入到我的数据库表中.我在SQL Server中有数据库.数据库表和字段excel文件是相同的.我想将excel的数据插入到我的数据库表中.那我该怎么办呢?
其他人提到使用Excel互操作读取注释中的Excel文件,但是对于可能有多个用户的Web应用程序这样做是不安全的./p>
要开始使用,请查看 Excel数据读取器项目.我已经多次使用它来处理Web应用程序中的Excel文件,并且效果很好.
I am developing on web application that will get the excel file using FileUpload control in asp.net c#. Now when click on submit button, i want to insert the excel data into my database table. I have database in SQL-Server. The field of database table & excel file are same.I want to insert that excel's data into my database table. So how can i do this?
Others have mentioned using Excel interop to read the Excel file in the comments, but this is NOT safe to do for a web application that may have multiple users.
To get started, have a look at the Excel Data Reader project. I've used this several times for processing Excel files from a web application and it works quite well.
这篇关于使用C#将Excel文件数据插入数据库表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!