Print
PDF
Sep
18

Exporting data to CSV file function is enhanced in Spire.DataExport 3.4

Today we are glad to announce a new release version of Spire.DataExport v3.4 for function enhancement. In this new version, we add a new feature (new property CSVOption.KeepingLineBreak) to support keeping/removing the line-breaks during exporting data to CSV file. More details are as followed:

Code Snippet:

string sqlConn=@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=..\..\datasource.mdb";
string sql = "select * from test";

using (OleDbConnection conn = new OleDbConnection(sqlConn))
{
	using (OleDbDataAdapter oda = new OleDbDataAdapter(sql, conn))
	{
		DataTable dataTable = new DataTable();
		oda.Fill(dataTable);

		TXTExport txtExport = new TXTExport();
		txtExport.ExportType = TextExportType.CSV;
		txtExport.CSVOption.AllowQuote = true;
		txtExport.AutoFitColWidth = true;
		txtExport.DataSource = ExportSource.DataTable;
		txtExport.DataTable = dataTable;
		txtExport.CSVOption.Separator = ",";
		
		//keeping the line-break
		txtExport.CSVOption.KeepingLineBreak = true;
		
		txtExport.DataEncoding = Spire.DataExport.Common.EncodingType.UTF8;
		txtExport.ExportLongColumn = true;
		txtExport.SaveToFile("exporttest1.csv");
	}
}




Welcome to experience Spire.DataExport for .NET with downloading here:

http://www.e-iceblue.com/Download/download-dataexport-for-net-now.html

Written by daisy zhang.