title: How to export data in a DataGridView to a text file in VB.NET
body: <p>I would like know the code, how to export the contents in a <code>DataGridView1</code> to a text file in VB.NET.
  I am using <code>Visual Studio 2019</code>. The table would contain:</p>
  
  <p>Sample:</p>
  
  <pre><code>-------------------------------------------------------------------------------------
  | Item Code | Item Name | Item Description      | Price    | In-Stock | Supplier    |
  -------------------------------------------------------------------------------------
  |12345      |Cupboard   |a small sized cupboard |Rs.15,000 |15        |ABC Industry |
  -------------------------------------------------------------------------------------
  |45689      |Chair      |a small chair          |Rs.10,000 |10        |ABC Industry |
  -------------------------------------------------------------------------------------
  and so on...
  </code></pre>
  
  <p>And in the text file the the data above will be stored as </p>
  
  <pre><code>12345|Cupboard|a small sized cupboard|15000|15|ABC Industry
  45689|Chair|a small chair|10000|10|ABC Industry
  and so on...
  </code></pre>
  
  <p>Thank you
  [shannon]</p>