在asp.net MVC中上传Excel文件并在Grid中显示 [英] Upload Excel File and display in Grid in asp.net MVC
问题描述
我需要将用户列表从excel导出到我的asp.net mvc(C#)应用程序。
I need to export the Users List from excel to my asp.net mvc(C#) application.
Excel应该有一个标题如名字姓氏电子邮件,...
及其值如                        John john@gmail.com
  ;                        &NBSP ;            David david@gmail.com
The Excel should have an header like First Name Last Name Email,...
and its values like John Smith john@gmail.com, David Beckam david@gmail.com,
需要验证值,然后将其存储到我的数据库并显示在下一页的网格中。
Need to validate the values before storing it to my database and show it in the grid of next page.
有没有
推荐答案
我认为最好在这种情况下使用ADO .NET。
I think that it would be best, in this case, to use ADO.NET.
有关如何执行此操作以便从Excel工作表中读取值的几篇文章:
A few articles on how to do this in order to read values from an Excel Worksheet:
(1)使用ADO.NET阅读和编写Excel电子表格C#DbProviderFactory(David Hayden)
(2)将Excel文件导入DataSet(CodeProject)
(3)使用ADO.NET(Lab49)阅读Excel电子表格的提示
(4) Reading Excel files from C# (Stack Overflow)
我认为这应该让你到你需要去的地方。
I think that this should get you to where you need to go.
- Mike
这篇关于在asp.net MVC中上传Excel文件并在Grid中显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!