如何在MVC中将数据从Excel导入SQL Server [英] How to import data from Excel into SQL Server in MVC
问题描述
我的要求是我想在我的MVC4应用程序中浏览该Excel文件,用户可以在其中选择该文件。我的数据库表和Excel工作表中都有一些列。在导入数据库表中的数据之前,应将Excel表中存在的列与数据库中的列进行比较。
1)选择包含Excel行中设计的数据列和表的Excel文件和列。
2)excel中的所有表和列也在SQL Server数据库中以相同的格式设计。
3)当我上传这个Excel文件时,我需要将Excel文件数据保存到与Excel中相同的数据库表中使用MVC4
My requirement is I want to browse that Excel file in my MVC4 application, where the user can select the file. There is a Some columns in both my database table as well as in the Excel sheet. Before importing the data in the table of the database the Columns present in the Excel sheet should be compared with the Columns in the database.
1)Selecting The excel file with data Columns and Tables designed in Excel rows and Columns.
2)All Tables and Columns like in excel also designed in SQL Server Database in a same format.
3)When I upload this Excel file i need to Save the Excel file data into Data base tables same as in Excel Using MVC4
推荐答案
在MVC中参考并尝试相同的方法
http://www.dotnetfox.com/articles/import-records-from-excel-sheet-to-sql-server-with-validations-in-Asp-Net-using-C -Sharp-1052.aspx [ ^ ]
如何对进口数据从-Excel的成-SQL服务器快车-2008-in-mvc3- with Checking列 [ ^ ]
Refer and try the same in MVC
http://www.dotnetfox.com/articles/import-records-from-excel-sheet-to-sql-server-with-validations-in-Asp-Net-using-C-Sharp-1052.aspx[^]
how-to-import-data-from-excel-into-sql-server-express-2008-in-mvc3- with Checking column[^]
这篇关于如何在MVC中将数据从Excel导入SQL Server的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!