Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Export dataset to CSV

stevenhollidgestevenhollidge Member Posts: 2

Hi,

I need to create a CSV file from SQL Server data from an ASP.NET or VB.NET app to mailmerge with MS Word.

I can populate a dataset from SQL Server and write to XML but MS Word can't use XML as a data source - damn!

Anyone got any ideas - other than cycling through the dataset and manually creating the text csv file?

Hopeful,
Steve

Comments

  • Chris__BChris__B Member Posts: 51
    Hi Steve,

    I've been looking for the exact same thing and have yet to find it. Currently I'm looping through a DataReader to create the CSV file and the performance isn't too bad (but obvioulsy not ideal). If you do come across it please post it and I'll do likewise.

    Chris

    :
    : Hi,
    :
    : I need to create a CSV file from SQL Server data from an ASP.NET or VB.NET app to mailmerge with MS Word.
    :
    : I can populate a dataset from SQL Server and write to XML but MS Word can't use XML as a data source - damn!
    :
    : Anyone got any ideas - other than cycling through the dataset and manually creating the text csv file?
    :
    : Hopeful,
    : Steve
    :

  • stevenhollidgestevenhollidge Member Posts: 2
    Hi Chris,

    Yeah I've done the same, but...

    I'm trying to create the CSV on the client machine (the app is an asp.net website) by when you use the IO.StreamWriter(file_name, False) code it just creates the CSV file on the server... any ideas?

    Cheers,
    Steve

    PS Will post another reply if I find dataset.WriteToCSV :o)

    : Hi Steve,
    :
    : I've been looking for the exact same thing and have yet to find it. Currently I'm looping through a DataReader to create the CSV file and the performance isn't too bad (but obvioulsy not ideal). If you do come across it please post it and I'll do likewise.
    :
    : Chris
    :
    : :
    : : Hi,
    : :
    : : I need to create a CSV file from SQL Server data from an ASP.NET or VB.NET app to mailmerge with MS Word.
    : :
    : : I can populate a dataset from SQL Server and write to XML but MS Word can't use XML as a data source - damn!
    : :
    : : Anyone got any ideas - other than cycling through the dataset and manually creating the text csv file?
    : :
    : : Hopeful,
    : : Steve
    : :
    :
    :

Sign In or Register to comment.