import from & export to excel

Please support our C# advertiser: $4.95 a Month - ASP.NET Web Hosting – Click Here!
Reply

Join Date: Sep 2008
Posts: 9
Reputation: deepas is an unknown quantity at this point 
Solved Threads: 0
deepas deepas is offline Offline
Newbie Poster

import from & export to excel

 
0
  #1
Nov 20th, 2008
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.
Reply With Quote Quick reply to this message  
Join Date: May 2008
Posts: 538
Reputation: Murtan is a jewel in the rough Murtan is a jewel in the rough Murtan is a jewel in the rough Murtan is a jewel in the rough 
Solved Threads: 86
Murtan Murtan is offline Offline
Posting Pro

Re: import from & export to excel

 
0
  #2
Nov 29th, 2008
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.
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 1,735
Reputation: LizR has a spectacular aura about LizR has a spectacular aura about 
Solved Threads: 186
LizR LizR is offline Offline
Posting Virtuoso

Re: import from & export to excel

 
0
  #3
Nov 29th, 2008
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.
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.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the C# Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC