PC Review


Reply
Thread Tools Rate Thread

How create a csv file from a datatable

 
 
radiohead
Guest
Posts: n/a
 
      16th Mar 2005
Is there a straightforward way of creating an excel/csv
file from a datatable. I don't know where to start with
this.

thank you.
 
Reply With Quote
 
 
 
 
Mohamoss
Guest
Posts: n/a
 
      16th Mar 2005
Hi
what you can do with one line of code it to write your table to an XML
file . Using the wirteXML command of datasets ( you can wrap your datatable
in a dataset object if it is not already contained inside one ) .
if you what to write it to excel however , you can create and adaptor that
is connected to excel file and use that adataper's update command to fill
the excel file with your datatable ( you will pass the dataset of your
table as a parameter to the update command of the adaptor)
Mohamed M .Mahfouz
Developer Support Engineer
ITWorx on behalf of Microsoft EMEA GTSC

 
Reply With Quote
 
shriop
Guest
Posts: n/a
 
      16th Mar 2005
My CSV parser will do it for you, but it is not free unfortunately.
http://www.geocities.com/shriop/index.html
There's a WriteAll method on the CsvWriter class that takes a DataTable
and will dump the contents directly to a file or stream.

 
Reply With Quote
 
rossum
Guest
Posts: n/a
 
      16th Mar 2005
On Wed, 16 Mar 2005 02:21:07 -0800, "radiohead"
<(E-Mail Removed)> wrote:

>Is there a straightforward way of creating an excel/csv
>file from a datatable. I don't know where to start with
>this.
>
>thank you.


All you ever wanted to know about CSV files:
http://www.creativyst.com/Doc/Articles/CSV/CSV01.htm

It is pretty easy to write your own class to output data in CSV to a
stream.

rossum


The ultimate truth is that there is no ultimate truth
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
create new datatable from existing datatable BostonNole Microsoft VB .NET 0 13th Sep 2006 10:34 PM
How to create a dbm file from DataTable ore.ber@gmail.com Microsoft Dot NET Framework 0 8th Aug 2006 11:35 AM
Create a Datatable from a SQL datatable column shema? jg Microsoft ASP .NET 1 17th Aug 2004 10:43 PM
Sort a datatable and create a new datatable Fredrik Rodin Microsoft ASP .NET 2 2nd Mar 2004 06:29 AM
Create DataTable From Existing DataTable Gimen Microsoft ADO .NET 5 14th Jan 2004 01:39 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:39 AM.