开发者

C# - Load simple Excel file into a datatable using FileUpload control

开发者 https://www.devze.com 2023-04-09 08:10 出处:网络
I\'m trying to figure out how to populate a datatable with data from and Excel file that\'s been uploaded using the FileUp开发者_Python百科load control. Does anyone know of a tutorial to do this?

I'm trying to figure out how to populate a datatable with data from and Excel file that's been uploaded using the FileUp开发者_Python百科load control. Does anyone know of a tutorial to do this?

I haven't been able to find anything on Google, maybe using wrong search terms?


Use LinqToExcel to parse data. Then, when you have the data in memory, put it into a database whichever way you prefer.


Perhaps an alternative way? This is vb.net but the same objects. I do this sort of thing all the time.

http://social.msdn.microsoft.com/Forums/en-US/isvvba/thread/7337ad66-7673-425b-97ff-41adbd8a68e9


Look at this:

http://forums.asp.net/t/1255191.aspx/1

It is C#, using OLEDB so third party libraries are not needed, and a DataTable is populated with the excel data.

These are my google search terms: "upload excel file to datatable c#"

0

精彩评论

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