Export Data to .CSV file

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
 
M

Mark

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
 
B

Bill Priess

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
 
D

dave wanta

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top