Hi everyone,
i'm exporting datagridview to txt file.
first 2 lines of txt are defined in advanced.
other lines of txt should be exported from datagridview.
I manage to do it, but for each line which will be written in txt i need to add 0x0D carriage return and 0x0A line feed.
Can you help me how to add carriage and line feed.
My code is bellow.
Thank you.
- tw.WriteLine(cban + cname + ccity + date + blanko + mbank + nula).ToString();
- tw.WriteLine(cban + cname + ccity + totamount.ToString() + totalxml.ToString() + blanko2 + type);
- for (int i = 0; i <= dataGridView1.Rows.Count - 1; i++)
- {
- for (int j = 0; j <= dataGridView1.Columns.Count - 1; j++)
- {
- sLine = sLine + dataGridView1.Rows[i].Cells[j].Value;
- }
- tw.WriteLine(sLine);
- sLine = "";
- }