title: How do I split the comma separated string in my text file and save each string in different variable?
body: <p>These is the content of my txt file which is saved in D drive in my pc</p>
  
  <pre><code>abc,1,2,3
  </code></pre>
  
  <p>I tried the flowing but it didn't work:</p>
  
  <pre><code>Dim stats() As String = File.ReadAllLines("C:/myfile.txt ")
  
  Dim data() As String = line.Split(","c)
  Dim query = From line In stats
  
  Country = Data(0)
  
  States = CInt(data(1))
  
  noOfcoders = CInt(Data(2))
  
  rank= CInt(Data(3))
  
  holidays = CInt(Data(4))
  contribution = CInt(Data(5))
  </code></pre>
  
  <p>edit</p>
  
  <p>I am getting error on this line.. data = line.Split(","c)...it says this line isn't in use anymore or something and that I rather use LineInput but thats asks for filenumber and i don't know what that is. I am sorry but I am a complete beginner. what else can I try?</p>
  
  <p>Exact error that I am getting:-</p>
  
  <blockquote>
    <p>Error  1   'Line' statements are no longer supported. File I/O functionality is available as 'Microsoft.VisualBasic.FileSystem.LineInput' and the graphics functionality is available as 'System.Drawing.Graphics.DrawLine'.   F:\My Documents\Mark Sanchez\Programming with lab (VB.net)\CIS170A_Lab07\CIS170A_Lab07\Form2.vb 62  16  CIS170A_Lab07</p>
  </blockquote>
  
  <hr>
  
  <p><strong>ok that error is gone now but now if I want to add these values to a list box..how can i do that?</strong></p>