title: C# output to .csv file not separating columns on commas
body: <p>I have a C# application that extracts a large amount of data from an SQL database and processes it. I want to output that data to a .csv file, but when I write it to the .csv file and open it, instead of finding my data separated into columns like so:  </p>
  
  <pre>
  Id       Model    Number of items
  10283    D        6
  5673     B        4
  224      X        2
  </pre>
  
  <p>I get:</p>
  
  <pre>
  Id,Model,Number of items
  10283,D,6
  5673,B,4
  224,X,2
  </pre>
  
  <p>This is the code I use to output the data to a .csv file:</p>
  
  <pre><code>using (StreamWriter w = new StreamWriter("C:\\Users\\User1\\Desktop\\test.csv"))
  {
      w.WriteLine("Id,Model,Number of items,etc.");
      w.Flush();
  
      //Products is a list of product, a custom class
      foreach (product p in products)
      {
          //All properties of p shown here are strings
          w.WriteLine(p.id.ToString() + ',' + p.model
              + ',' + p.num.ToString());
  
          w.Flush();
      }
  }
  </code></pre>
  
  <p>I have tried using AppendAllText() and WriteAllText() instead of this method, and using a tab character as a delimiter instead of a comma, but I get the same result.<br>
  I can't seem to find anyone with the same problem with google, in fact, when I search for this issue, I get results of people who want to get commas instead of columns in their data, the exact opposite problem to this.</p>