Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default DataSet to Excel/text

Hi,

Please could someone help me do the following in VB .NET. I would like to
know the most efficient way to write a populated dataset to a csv or text
file, naming and labelling the file and sheet. Is one able to use
dataset.writeXML(path). I can get this to work but I would like it in
normal excel format rather then xml code.

Any examples would be much appreciated.



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default DataSet to Excel/text

Activeworkbook.SaveAs Filename:="ABCD.csv", FileFormat:=xlCSV

would be the way to write it in VBA. Assume it would be similar in .NET.

--
Regards,
Tom Ogilvy

"11Oppidan" wrote in message
...
Hi,

Please could someone help me do the following in VB .NET. I would like to
know the most efficient way to write a populated dataset to a csv or text
file, naming and labelling the file and sheet. Is one able to use
dataset.writeXML(path). I can get this to work but I would like it in
normal excel format rather then xml code.

Any examples would be much appreciated.





  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default DataSet to Excel/text

"most efficient way" is a loaded phrase, and you wouldn't write an
entire dataset to a csv file, you'd have to just write a DataTable's
worth. You also wouldn't be able to specify sheet name, because that's
specific to xls and not csv. Csv can basically only hold one flat
tables worth of data. I do have a component that will handle this for
you, which I'm sorry to say is not free, if that's a requirement. It is
however only one line other than creating the component and disposing
the component. I also have a benchmarks page that compares "efficiency"
of my component vs the jet driver and the microsoft text driver. The
method to look for is CsvWriter.WriteAll. It's in the help docs, and
used in the Tab Delimited to CSV sample. There's also a demo version
available for download to see how it works.

http://www.geocities.com/shriop/index.html is the main page. There's a
samples link, benchmarks link, help docs link, and demo version link
all off of that page.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 225
Default DataSet to Excel/text

Hi

You also take a look at the link below.
HOW TO: Transfer Data to an Excel Workbook by Using Visual Basic .NET
http://support.microsoft.com/?id=306022

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel dataset size Kenallen Excel Discussion (Misc queries) 0 August 1st 07 07:54 PM
How do I customize the X-axis in excel to match my dataset? cathy Charts and Charting in Excel 1 January 14th 05 01:25 AM
Create Excel Document from a Dataset using VB.Net Jacob Philip Excel Programming 1 February 19th 04 08:40 AM
Want to Bind ADO Dataset to Excel 2003 Pivottable Dan[_19_] Excel Programming 0 January 21st 04 01:26 PM
Passing a dataset from jsp to browser excel plugin JM Patton Excel Programming 0 September 11th 03 09:22 PM


All times are GMT +1. The time now is 11:01 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"