| | |
import from & export to excel
Please support our C# advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Sep 2008
Posts: 11
Reputation:
Solved Threads: 0
I have to insert certain data in excel to sql database on weekly basis & also has to dump a report shown in gridview control to excel so can anyone help me to import data from excel to datagrid view so that user can upload in one click.And how to export in excel from gridview.plz help me ,its urgent 4 me.
•
•
Join Date: May 2008
Posts: 538
Reputation:
Solved Threads: 86
I'm not certain I understand your question or what you need help with. (Specific questions usually get faster and better answers.)
Are you saying that you need to write an application that will be run weekly to extract data from an Excel worksheet and insert it into an SQL database?
The application should also display the data that it is adding (or did add) to the database in a datagrid so the user can view it?
Does the datagrid view need to happen before putting the data in the database? (Is it some form of verification step?)
How does the application know where to find the Excel worksheet?
What data from the Excel worksheet needs to be added to the database?
I suspect that your application will be using COM automation to have open Excel and read the data from the worksheet. (I've done this from Python quite effectively and it should be easier in C#)
You then load the data you extract into the datagrid.
Once the user 'approves' the data, you would generate SQL statements to insert or update the data in the database.
Based on the given information that's about all I can come up with.
If you want more assistance, show us what you have done, or what you're having problems with.
Are you saying that you need to write an application that will be run weekly to extract data from an Excel worksheet and insert it into an SQL database?
The application should also display the data that it is adding (or did add) to the database in a datagrid so the user can view it?
Does the datagrid view need to happen before putting the data in the database? (Is it some form of verification step?)
How does the application know where to find the Excel worksheet?
What data from the Excel worksheet needs to be added to the database?
I suspect that your application will be using COM automation to have open Excel and read the data from the worksheet. (I've done this from Python quite effectively and it should be easier in C#)
You then load the data you extract into the datagrid.
Once the user 'approves' the data, you would generate SQL statements to insert or update the data in the database.
Based on the given information that's about all I can come up with.
If you want more assistance, show us what you have done, or what you're having problems with.
•
•
Join Date: Aug 2008
Posts: 1,735
Reputation:
Solved Threads: 186
There are a shed load of posts in this forum about reading, writing and manipulating excel through c#, most of which contain code.
Please search, then when you get stuck on a specific bit and youv'e written code and its not working, post the code, and we'll try help.
Please search, then when you get stuck on a specific bit and youv'e written code and its not working, post the code, and we'll try help.
Did I just hear "You gotta help us, Doc. We've tried nothin' and we're all out of ideas" ? Is this you? Dont let this be you! I will put in as much effort as you seem to.
![]() |
Other Threads in the C# Forum
- Previous Thread: Getting basic with Visual Studio in C#
- Next Thread: mobile phones
| Thread Tools | Search this Thread |
.net access algorithm alignment app array barchart bitmap box broadcast c# c#gridviewcolumn cast check checkbox client combobox communication control conversion csharp custom database datagrid datagridview dataset datatable datetime degrees development draganddrop drawing elevated encryption enum excel file focus form format forms function gdi+ hospitalmanagementsystem httpwebrequest image index input install java label list listbox localization login mandelbrot math messagebox mouseclick mysql operator path photoshop picturebox pixelinversion plotting pointer post programming radians read regex remote remoting richtextbox server sleep socket sql statistics stream string stringformatting sun table text textbox thread time timer update usercontrol validation visualstudio webbrowser whileloop windows winforms wpf xml






