Click here to Skip to main content
Rate this:
 
Please Sign up or sign in to vote.
See more: Windows Forms
How to upload excel files in windows foms using c#
Posted 11-Feb-13 1:22am
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
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

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[^].
  Permalink  
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 2

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.
  Permalink  

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


Web01 | 2.8.160204.4 | Advertise | Privacy
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100