vb.net - ASP.Net Generate and Save CSV using System.Web.HttpResponse -
Hi I am using the following code to generate a CSV file containing data from a dataset. CSV fixes and displays a prompts box so that the user can either open or save the CSV file. What I am thinking is it possible to save the CSV file?
Thanks for any help
edit with solution (NB) I do not need a prompt box to open because I will write additional code to create and save many files. Show them links). It saves the dataset as a CSV on our server.
Protected sub-export Btn_click (as a bi-directional sender, e-mail as a system). As the new chartnew.csvhelper dim strData1 like string = csv.Export (ds1, True) nowadays date as date = date. Now. Date today as string = nowadays Toastring ("ddMMyyyy") is a filtered filename string = AJST & amp; "_filename.csv" as the slow saveDir string = "writedir \ files \" dim as the apppath string = as request. Physical ApplicationsType String FilePath String = Eppath + Reserved + Filename Writer As a New Stream Driiter Author (Filipath) Write (strData1) Author using a StreamWriter: code> SwimFromFile.Write = new streamer (filename) (StrData1) SwFromFile.Flush () SwFromFile.Close ()
Comments
Post a Comment