|
-
Jun 12th, 2009, 02:39 AM
#1
Thread Starter
New Member
[RESOLVED] Fill a Listview with info from .txt file
Hi,
In a mobile application I need to read from a .txt file and fill with information a ListView Control. I don't know why a receive an error.
The code is below:
Dim StreamReader As IO.StreamReader
Dim line As String
StreamReader = New IO.StreamReader("Smart Card\fisier.txt")
While StreamReader.Peek <> -1
line = StreamReader.ReadLine()
ListView1.Items.Add(line)
End While
The error message is in "ListView1.Items.Add(line)"; "Error 1 Value of type 'String' cannot be converted to 'System.Windows.Forms.ListViewItem'.
The .txt file contain first name and given name separated by a space and I want to display the list of names in a ListView Control.
Can anybody help me?
Thank you,
Robert
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|