You could open a file to a predefined location with a random name,
write the db contents there and submit a link to the user.
To write to a file you can use a snippet similar to :
StreamWriter writer = new StreamWriter(File.Create('tempFileName'));
while (rdr.read()) {
writer.WriteLine('data');
}
writer.close();
and then send a link pointing to the file you 've created.
An alternative would be to create a HttpModule that could respond to a
specfic URL and output text/csv content, or a file with as an
attachment.
Regards,
Tasos
^MisterJingo^ wrote:
Hi all,
I need some help on how to generate and write a CSV file in my ASP app
(i'm using c#). Ideally I'd like to generate the CSV file from the DB
and then offer it for download to the user, but i'm unsure where I
should start.
Any help would be appreciated.