开发者

Upload Excel File and display in Grid in asp.net MVC

开发者 https://www.devze.com 2022-12-08 11:51 出处:网络
I need to export the Users List from excel to my asp.net mvc(C#) application. The Excel should have an header like First Name Last Name Email,...

I need to export the Users List from excel to my asp.net mvc(C#) application.

The Excel should have an header like First Name Last Name Email,...

and its values like                                  John          Smith           john@gmail.com,                                                               David         Beckam    开发者_JS百科;   david@gmail.com,

Need to validate the values before storing it to my database and show it in the grid of next page.

Is there any easy way to do it, like a plugin?


I think that it would be best, in this case, to use ADO.NET.

A few articles on how to do this in order to read values from an Excel Worksheet:

(1) Reading and Writing Excel Spreadsheets Using ADO.NET C# DbProviderFactory (David Hayden)

(2) Import Excel File to DataSet (CodeProject)

(3) Tips for reading Excel spreadsheets using ADO.NET (Lab49)

(4) Reading Excel files from C# (Stack Overflow)

I think that this should get you to where you need to go.

-- Mike

0

精彩评论

暂无评论...
验证码 换一张
取 消