title: StreamWriter not writing last value
body: <p>I have some code which executes a SQL Stored Procedure and then writes the result to a CSV file, however the last value is not being written to the file. </p>
  
  <p>Code:</p>
  
  <pre><code>conn = new SqlConnection(_sConnectionString);
  conn.Open();
  
  SqlCommand cmd = new SqlCommand("usp_PS_Test", conn);
  cmd.CommandType = CommandType.StoredProcedure;
  cmd.Parameters.Add(new SqlParameter("@ExportDate", DateTime.Now));
  cmd.Parameters.Add(new SqlParameter("@SiteId", _iSiteId));
  
  using(SqlDataReader rdr = cmd.ExecuteReader())
      using(StreamWriter salesWriter = new StreamWriter(_sSalesFileName))
          while(rdr.Read())
          {
              salesWriter.WriteLine("{0},{1},{2},{3},{4}",rdr["TransactionDate"],rdr["ProductCode"] , rdr["Qty"] ,rdr["Price"] , rdr["NominalCode"]);
          }
  </code></pre>
  
  <p>The column "NominalCode" is not being written to the file, any suggestions?</p>
  
  <p>I have tried the same code but with a different stored procedure and again the last column is missing.</p>
  
  <p>Data returned from stored procedure:</p>
  
  <pre><code>TransactionDate ProductCode Qty Price   NominalCode
  2015-07-30 00:00:00 SERVICE 1   45.00   4000001
  2015-07-30 00:00:00 SERVICE 1   15.00   4000001
  </code></pre>
  
  <p>Also, stupid moment, how can i format the "Price" column to be to currency/money format?</p>
  
  <p>Thank You</p>