I'm trying to load an access database table into a listview's columns. I 've managed to load the first 4 columns of the database but there is a problem with the 5th one.
Public Sub DisplayPasswords() Passes.Items.Clear() Dim dt As New DataTable Dim ds As New DataSet ds.Tables.Add(dt) Dim da As New OleDbDataAdapter("Select * from passwords", con) da.Fill(dt) Dim myRow As DataRow For Each myRow In dt.Rows Passes.Items.Add(myRow.Item(1)) Passes.Items(Passes.Items.Count - 1).SubItems.Add(myRow.Item(2)) Passes.Items(Passes.Items.Count - 1).SubItems.Add(myRow.Item(3)) Passes.Items(Passes.Items.Count - 1).SubItems.Add(myRow.Item(4)) Passes.Items(Passes.Items.Count - 1).SubItems.Add(myRow.Item(5)) Next End Sub The error:
Overload resolution failed because no Public 'Add' can be called with these arguments: 'Public Function Add(item As System.Windows.Forms.ListViewItem.ListViewSubItem) As System.Windows.Forms.ListViewItem.ListViewSubItem': This is an image of the error I get: https://i.sstatic.net/fHx1S.png
This is an image of my access database: https://i.sstatic.net/2tuZl.png
This is an image of my listview: https://i.sstatic.net/aVR7y.png
myRow.Item(5)? How is it different from the other items before it? What is the type expected by.Add()?