View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
shriop shriop is offline
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.