No it is not another machine on the same network as the server I have uploaded that application at client's machine and accessing it through my local machine and want to save a file in CSV format into my local machine's C:drive,is it possible please provide me proper solution
I have given path as C:\\Owner
here is my CSV create method
public void CreateCSVFile(DataTable dt, string strFilePath)
{
StreamWriter sw = new StreamWriter(strFilePath, false);
int iColCount = dt.Columns.Count;
foreach (DataRow dr in dt.Rows)
{
for (int i = 0; i < iColCount; i++)
{
if (!Convert.IsDBNull(dr[i]))
{
sw.Write(dr[i].ToString())
}
if (i < iColCount - 1)
{
sw.Write(",");
}
}
sw.Write(sw.NewLine);
}
sw.Close();
}
Main Topics
Browse All Topics





by: daniel_ballaPosted on 2007-09-19 at 04:15:35ID: 19919582
It depends how do you define your local machine. If it is just another machine on the same network as the server where the app is running (assuming that this is an asp.net app running on an IIS server) then you can use the System.IO.File class to save it over a network share (not recommended, but it is a solution).
If by your machine you mean just any client connecting to the app through HTTP, then you should expose a link that points to the file and the users can use to download it.
Does this make sense?