StreamWriter sw new StreamWriter filename par DataTable tpart GetDataT

1
2
3
4
5
6
7
8
9
StreamWriter sw = new StreamWriter("filename.par");
DataTable tpart = GetDataTablePart(...);
sw.WriteLine(string.Join(";", tpars.Columns.Cast<DataColumn>().Select(s=>s.Name));
foreach(DataRow row in tpart.Rows)
{
sw.WriteLine(string.Join(";", row.ItemArray.AsEnumarable().Select(s=>s.ToString()));
}
sw.Flush();
sw.Close();