Storing the records in csv file from datatable.

Posted by Harikrishna on Stack Overflow See other posts from Stack Overflow or by Harikrishna
Published on 2010-05-01T06:51:36Z Indexed on 2010/05/01 6:57 UTC
Read the original article Hit count: 184

Filed under:
|
|
|
|

I have datatable and I am displaying those values in the datagridview with the helping of code :

   dataGridView1.ColumnCount = TableWithOnlyFixedColumns.Columns.Count;
   dataGridView1.RowCount = TableWithOnlyFixedColumns.Rows.Count;
   for (int i = 0; i < dataGridView1.RowCount; i++)
   {
       for (int j = 0; j < dataGridView1.ColumnCount; j++)
       {
           dataGridView1[j, i].Value = TableWithOnlyFixedColumns.Rows[i][j].ToString();
       }
   }
   TableExtractedFromFile.Clear();
   TableWithOnlyFixedColumns.Clear();

Now I want to save the records in the datatable in csv file.How can I do that ?

© Stack Overflow or respective owner

Related posts about c#

Related posts about .NET