Quantcast
Channel: Visual C# forum
Viewing all articles
Browse latest Browse all 31927

aspx c# user specified directory

$
0
0

Hi there,

I have a button on my webpage to export to CSV a SQL statement. While I have the code working perfectly, I cannot specify the filepath to save to and I am getting the file saved automatically to my roaming profile. How can allow the user to specify the path to save the file to?

Here is the code I am using:

protected void btnExport_Excel_Click(object sender, ImageClickEventArgs e)
    {
        DateTime theDate = DateTime.Now;
        decimal yada = Convert.ToDecimal(theDate.Date.ToString("yyyyMMdd"));
        string finaldate = yada.ToString();
        string fileName = finaldate + "_business_unit.csv";
        SQLToCSV("select * from dbo.business_unit", fileName);
    }

the SQLToCSV works perfectly fine, its just the to get the user specified path into the FileName.

Any assistance would be appreciated.

Regards

mbardon


Regards mBardon


Viewing all articles
Browse latest Browse all 31927

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>