CleanCode C# Libraries v0.9.23 API

CsvWriter Class

Writes a DataTable to a CSV file.

For a list of all members of this type, see CsvWriter Members.

System.Object
   CsvWriter

public class CsvWriter

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Remarks

This class follows the standard conventions for creating a CSV (comma-separated value) file, as described on Wikipedia. That is, any special characters (quotes, newlines, commas) require enclosure within quotes. That capability was added to the basic code found at Export ASP.Net DataGrid DataSet To CSV File.

The first record of the generated file is a header row. This row consists of the names of each column from the DataTable together with their data types in the format name:type. For example, an integer column with the name "Id" will have the value Id:System.Int32.

Since CleanCode 0.9.13.

Requirements

Namespace: CleanCode.Data

Assembly: CleanCode (in CleanCode.dll)

See Also

CsvWriter Members | CleanCode.Data Namespace | CsvReader