Click here to Skip to main content
15,897,273 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
How to upload excel files in windows foms using c#
Posted
Comments
Maciej Los 11-Feb-13 6:26am    
What have you done so far?
Do you want to display uploaded data?
devchina 11-Feb-13 8:25am    
after uploading excel(web apll we can upload files using fileupload control but how to upload excel files in win forms) file i want to maintain that data in datatable to access anywhere in my application
Pete O'Hanlon 11-Feb-13 7:08am    
Upload them to where? A web site? An FTP site? A server your application has access to?
devchina 11-Feb-13 8:25am    
after uploading excel(web apll we can upload files using fileupload control but how to upload excel files in win forms) file i want to maintain that data in datatable to access anywhere in my application

Steps to do:
1) create new project (windows application),
2) add DataGridView control to your Form,
3) use OleDbConnection[^], OleDbCommand[^] to get data from Excel; to build correct connectionstring, see here: http://www.connectionstrings.com/[^]
4) use DataTable[^] as a source of your DataGridView.DataSource[^].
 
Share this answer
 
If you want to work with Excel files in WinForms you can use this .NET Excel Reader[^] to export data from excel files or this .Net Excel Writer[^] to read/write/create xls, xlsx, csv files.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900