title: Write Rows from DataTable to Text File
body: <pre><code>public void GenerateDetailFile()
  {
    if (!Directory.Exists(AppVars.IntegrationFilesLocation))
    {
      Directory.CreateDirectory(AppVars.IntegrationFilesLocation);
    }
  
    DateTime DateTime = DateTime.Now;
    using (StreamWriter sw = File.CreateText(AppVars.IntegrationFilesLocation +
                                  DateTime.ToString(DateFormat) + " Detail.txt"))
    {
      DataTable table = Database.GetDetailTXTFileData();
  
      foreach (DataRow row in table.Rows)
      {
        sw.WriteLine(row);
      }
    }
  }
  </code></pre>
  
  <p>Not sure what I'm missing here but I think it might be the column name which I'm not sure how to set it up.</p>
  
  <p>This is working fine, except, when it writes to the text file, it's writing this:</p>
  
  <p>System.Data.DataRow<br>
  System.Data.DataRow<br>
  System.Data.DataRow<br>
  System.Data.DataRow<br>
  System.Data.DataRow<br>
  System.Data.DataRow<br>
  System.Data.DataRow<br>
  System.Data.DataRow<br>
  System.Data.DataRow<br>
  System.Data.DataRow<br></p>
  
  <p>Can anyone give me a hand?</p>