transfer contends from database table to excel

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

Join Date: Dec 2007
Posts: 200
Reputation: carobee is an unknown quantity at this point 
Solved Threads: 11
carobee carobee is offline Offline
Posting Whiz in Training

transfer contends from database table to excel

 
0
  #1
Oct 16th, 2008
hi,
i want to transfer the contends of a table from database to excel. can i declare a excel sheet in c#
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: transfer contends from database table to excel

 
0
  #2
Oct 16th, 2008
Have an ask of google. Google knows the answers
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  
Join Date: Dec 2007
Posts: 200
Reputation: carobee is an unknown quantity at this point 
Solved Threads: 11
carobee carobee is offline Offline
Posting Whiz in Training

Re: transfer contends from database table to excel

 
0
  #3
Oct 16th, 2008
done dat. am able to do it now. but i want the column names also. Is that possible?
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: transfer contends from database table to excel

 
0
  #4
Oct 16th, 2008
f you need to putput it, and keep the names, put the names into an array you can output as a header line.
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  
Join Date: Dec 2007
Posts: 200
Reputation: carobee is an unknown quantity at this point 
Solved Threads: 11
carobee carobee is offline Offline
Posting Whiz in Training

Re: transfer contends from database table to excel

 
0
  #5
Oct 16th, 2008
Also if i want to save it somewhere of my wish what would the code be like. i have defined a workbook also populated the values. now while saving it is saving in the same place where project is created. i want to save it in some other place. my code is
wb.SaveAs(FileName,Excel.XlFileFormat.xlWorkbookNormal,
null,null,false,false,Excel.XlSaveAsAccessMode.xlShared,
false,false,null,null,null);
what changes do i make?
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: transfer contends from database table to excel

 
0
  #6
Oct 16th, 2008
Change the filename.. or is there some hidden part to that question
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  
Join Date: Dec 2007
Posts: 200
Reputation: carobee is an unknown quantity at this point 
Solved Threads: 11
carobee carobee is offline Offline
Posting Whiz in Training

Re: transfer contends from database table to excel

 
0
  #7
Oct 16th, 2008
  1. wb.SaveAs(FileName,Excel.XlFileFormat.xlWorkbookNormal,
  2. null,null,false,false,Excel.XlSaveAsAccessMode.xlShared,
  3. false,false,null,null,null);

this is my code ? can you suggest any solution
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: transfer contends from database table to excel

 
-1
  #8
Oct 16th, 2008
Now you really are being stupid

the contents of "Filename" has to be what you wanted..
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  
Join Date: Dec 2007
Posts: 200
Reputation: carobee is an unknown quantity at this point 
Solved Threads: 11
carobee carobee is offline Offline
Posting Whiz in Training

Re: transfer contends from database table to excel

 
0
  #9
Oct 22nd, 2008
The contents of "Filename" that i can provide is just the any name for the file, not like "C:\....". it is getting saved in my documents folder.
Please give a proper solution
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: transfer contends from database table to excel

 
0
  #10
Oct 22nd, 2008
Sorry, but you are being stupid,

Put the path in your filename, and it will be saved where you tell it..... If you dont it would be saved in whats the "current directory"
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:


Thread Tools Search this Thread



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

©2003 - 2009 DaniWeb® LLC