| | |
import from & export to excel
Please support our C# advertiser: $4.95 a Month - ASP.NET Web Hosting – Click Here!
![]() |
•
•
Join Date: Sep 2008
Posts: 9
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 angle array asp.net bitmap box broadcast c# capturing check checkbox client combobox control conversion csharp database databasesearch datagrid datagridview dataset datetime dbconnection degrees delegate design development disappear draganddrop drawing encryption enum eventhandlers excel file firefox form format forms function gdi+ grantorrevokepermissionthroughc#.net image input install interface java libraries list loop marshalbyrefobject math monodevelop mouseclick movingimage msword mysql operator path pause photoshop php picturebox pixelinversion platform polynomial post programming properties radians regex remoting richtextbox server sleep socket sql statistics string study system.servicemodel table tcpclientchannel text textbox thread time timer update usb usercontrol validation virtualization visualbasic visualstudio wpf wpfc# xml






