Answers for "c# wirite to csv"

C#
1

c# wirite to csv

//before your loop
    var csv = new StringBuilder();

//in your loop
    var first = reader[0].ToString();
    var second = image.ToString();
    //Suggestion made by KyleMit
    var newLine = string.Format("{0},{1}", first, second);
    csv.AppendLine(newLine);  

//after your loop
    File.WriteAllText(filePath, csv.ToString());
Posted by: Guest on December-07-2020

C# Answers by Framework

Browse Popular Code Answers by Language