I am trying to create a text file by a loop data .each loop data i have send to another method and creating the text file as blow .
//another method each and every for loop time this method will run.
public void TextFileGen1(string pdate, string oPno, string supCode, string supName, string cur, string docTotal, string glAct, string glName, string pType, string jRemark, string rmk)
{
if (pType == "CEFT")
{
using (System.IO.StreamWriter file = new System.IO.StreamWriter(@"E:\filename.txt", true))
{
file.Write(pdate, oPno, supCode);
}
}
else
{
using (System.IO.StreamWriter file = new System.IO.StreamWriter(@"E:\DFCC\filename.txt", true))
{
file.Write(pdate, oPno, supCode);
}
}
}
Current output is like this:
20201228 20201229
But I expected this output:
20201229,hgfd,gfd
20201228,yhgtfr,hygtfr
Please could anyone tell me how to do it.