CsvHelper
CsvHelper copied to clipboard
can't write csv
hi,3ks 4 your code. but it can't wirte csv,and i try add “writer.Flush();” in method “NextRecord()",than it works. please check it out. thank u again!
using( var stream = File.OpenWrite( "my location" ) )
using( var writer = new StreamWriter( stream ) )
using( var csv = CsvWriter( writer ) )
{
var myRecords = new List<MyRecord>();
// Fill myRecords with your data
csv.WriteRecords( myRecords );
}
yeah! everything is ok. i use memorystream and than use streamWriter.Flush() in my code, it works. but the examples in CsvHelper.Example project has a little problem, all write methos does not work.
thanks!
I should really delete that example project. It wasn't meant for other people to use and was created before I put this code on github.