I am using FileHelpers to write DataTable content into CSV file.
Because of huge number of records in DataTable I chose to dump the result set as it is in DataTable into CSV file like below
CommonEngine.DataTableToCSV(dt, filename)
And the CSV has sucessfully written with 2 million records having the size of 150MB.
But I wanted to add the filed header at first line of this CSV file.
Is there a way FileHelper will allow to write the header using CommonEngine.DataTableToCSV?
You must use engine.HeaderText = engine.GetFileHeader() before you call WriteFile
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With