Can someone please help me.
I am getting error: The process cannot access the file 'c:\reports\PaymentDetailReport.xml' because it is being used by another process. in following function.
This method is suppose to be called couple of times. but at second time, it throws the error. I have even closed tw.
private void saveReport(string reportName, string data)
if (reportName == "PaymentReport")
StreamWriter tw = new StreamWriter(_documentName);
StreamWriter masterPSDR = File.AppendText("C:\\reports\\masterPSDR.xml");