title: CSV file to datagridview using list
body: <p>This is similar to:
  <a href="https://social.msdn.microsoft.com/Forums/en-US/7b0e28b4-c1ef-49d6-8f46-11b379428052/import-from-csv-file-to-two-dimensional-array?forum=vbgeneral" rel="nofollow">https://social.msdn.microsoft.com/Forums/en-US/7b0e28b4-c1ef-49d6-8f46-11b379428052/import-from-csv-file-to-two-dimensional-array?forum=vbgeneral</a></p>
  
  <p>but the code that Cor Ligthert suggests doesn't work even though its exactly what I need.</p>
  
  <p>The code is:</p>
  
  <pre><code>Public Class Form1
  
  Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
      Dim FILE_NAME As String = "C:\Users\Admin\Documents\test.csv"
  
      Dim OutlookLines As New List(Of OutlookLine)
      Dim sr As New IO.StreamReader(FILE_NAME)
      Do Until sr.EndOfStream
          OutlookLines.Add(New OutlookLine With {.line = sr.ReadLine})
      Loop
      DataGridView1.DataSource = OutlookLines
  
  End Sub
  
  
  Private Class OutlookLine
      Private theLine As String
      Public Property line() As String
          Get
              Return theLine
          End Get
          Set(ByVal value As String)
              theLine = value
          End Set
      End Property
  End Class
  
  End Class
  </code></pre>
  
  <p>I try putting in:</p>
  
  <pre><code>.Split(","c)
  </code></pre>
  
  <p>after sr.ReadLine but it says "Value of type 1-D array of String cannot be converted to String"</p>
  
  <p>The code above works fine but each row of the csv is scrunched into one column (obviously because I am not splitting it at the ",").</p>
  
  <p>csv data:</p>
  
  <pre><code>1,2,3,4,5
  6,7,8,9,0
  </code></pre>