Retrieving data from .CSV file and displaying it in ListView Help!!!

Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Jul 2008
Posts: 2
Reputation: mobman is an unknown quantity at this point 
Solved Threads: 0
mobman mobman is offline Offline
Newbie Poster

Retrieving data from .CSV file and displaying it in ListView Help!!!

 
0
  #1
Jul 5th, 2008
Hey guys I am a VB noob and need some help, basically this is what I want to do please look at the following picture


CLICK FOR PICTURE

The app should basically pull up the data contained within this CSV file :
CLICK FOR CVS FILE

and display it in the listview with 2 columns (with the values seperated for each column in the listview).

Here is that code I have so far (keep in mind I am a noob)

Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. Dim objReader As IO.StreamReader
  2. Dim intcount As Integer
  3. Dim intcount2 As Integer
  4.  
  5.  
  6. If IO.File.Exists("f:\surveydata.csv") = True Then
  7. objReader = IO.File.OpenText("f:\surveydata.csv")
  8.  
  9.  
  10. Do While objReader.Peek <> -1
  11. _strRespondend(intcount) = objReader.ReadLine()
  12. _strMilk(intcount) = objReader.ReadLine()
  13. intcount += 1
  14. Loop
  15.  
  16. For intcount = 0 To (_strRespondend.Length - 1)
  17. Me.lstSurveyDisplay.Items.Add(_strRespondend(intcount))
  18.  
  19.  
  20. 'Do While objReader.Peek <> -1
  21. '_strMilk(intcount2) = objReader.ReadLine()
  22. '
  23. ' intcount2 += 1
  24.  
  25. 'Loop
  26. Next
  27.  
  28. For intcount2 = 0 To (_strMilk.Length - 1)
  29. Me.lstSurveyDisplay.Items(intcount2).SubItems.Add(_strMilk(intcount2))
  30.  
  31.  
  32.  
  33. Next
  34.  
  35.  
  36. objReader.Close()
  37.  
  38. Else
  39. MessageBox.Show("The file is not available. Please restart the program when file is available.", "Error")
  40. Me.Close()
  41.  
  42. End If
  43.  
  44. End Sub



Any idea how to go about this one? I'd really appreciate your input. Thanks~
Last edited by mobman; Jul 5th, 2008 at 2:25 am.
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 2
Reputation: mobman is an unknown quantity at this point 
Solved Threads: 0
mobman mobman is offline Offline
Newbie Poster

Re: Retrieving data from .CSV file and displaying it in ListView Help!!!

 
0
  #2
Jul 5th, 2008
please help some1!!!
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the Visual Basic 4 / 5 / 6 Forum


Views: 1015 | Replies: 1
Thread Tools Search this Thread



Tag cloud for Visual Basic 4 / 5 / 6
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC