1

I am using LinqToCsv to export data from a database to a csv file. One of the columns is a DateTime object. Upon export, the DateTime column shows up as "#######" until I manually expand the column width to fit the entire DateTime output. Is there a way to manually set column widths so that I don't have to manually expand the row every time?

Ultracoustic
  • 309
  • 2
  • 4
  • 14

2 Answers2

1

A csv file has no concept of column widths. You could possibly export an .xlsx file instead using a library such as EPPlus

Stewart_R
  • 13,764
  • 11
  • 60
  • 106
0

CSV has no format attached. It is a plain text file comma/semicolon separated. You see the file that way because Excel is showing "empty" style for it. If you open the file with a notepad you´ll see the data correctly. If you need any style you´ll have to migrate to a XLSX or XLS file.

NicoRiff
  • 4,803
  • 3
  • 25
  • 54