Reputation: 199
I have a .csv file that I am reading into C# via an OLEDBConnection. I am loading this into a DataSet. This step works fine. My data in the .csv file does not have any heading data/column headings. I want to add column headings to my DataSet in C# rather than directly into the .csv file. If I try to add column headings, then it just creates a new column on the end of the data, however I want to add the heading to the existing columns that already have data in it rather than create a new column.
Upvotes: 0
Views: 220
Reputation: 116
Just access the column using index and the change the name
DataTable table = your datatable;
table.Columns[0].ColumnName = "Foo";
Upvotes: 1