Export Data to .CSV file

  • Thread starter Thread starter JP
  • Start date Start date
J

JP

Hi,

I want to export data to a .csv file in a way that a "Save
Dialog" opens up and allows users to select the File Path
and the File Name to save.

How do I do this?

Thank You,
JP
 
JP,

To create the .csv file, use File IO to write a comma delimited file from a
data reader.

Then, create a hyperlink to this file dynamically. When the user clicks on
the link, it will ask them if they want to Open / Save it, just like any
other file download on the internet.

Good luck

Mark
www.dovetaildatabases.com
 
Also, if you do not want the extra step of having your users click on a
link, you could do a Response.WriteFile() and have the save as dialog open
automatically.

HTH,

Bill
 
btw, if you don't have Write access to the hard drive, you could just create
an in-memory byte array of the CSV and then just write it to the output
stream.

This would mean the CSV is generated on every request, but if it is unique,
it may not matter.

hth,
Dave
www.aspNetEmail.com
 
Back
Top