Last post Jul 10, 2009 10:19 AM by fahimataspnetforums
Jul 10, 2009 08:46 AM|fahimataspnetforums|LINK
Usually, we select data rows from SQL Table onto control in asp.net, like Grdview etc.
I need to select rows and write it to file like xls, csv or rpt, etc and then save the file or zip the file to ftp server or server hardware, for example.
In other words, I want to be able to do the same thing asp.net what we do on SSMS , we got Query menu and set Results to file and when we run the select query, it saves the file to file system with selected rows.
Any advice or sample code for this or any tool that I am not aware of.
Jul 10, 2009 09:17 AM|pmourfield|LINK
You could either roll your own solutions similar to what's being done here http://weblogs.asp.net/kannanambadi/archive/2008/03/25/exporting-dataset-as-csv.aspx
or you may want to consider using SQL Reporting Services
Jul 10, 2009 10:19 AM|fahimataspnetforums|LINK
Thanks for your advice.
Reporting service is not an option as our DB server is on hosting site where the rows will be selected and put in file and then save on server disk.
the link is using Gridview. I want to do something in background. Based on user selection, I want to run the piece of code to export desired rows into file and then save it on Filesystem.