franz081227
Member
- Joined
- Sep 1, 2008
- Messages
- 8
- Programming Experience
- Beginner
An unhandled exception of type 'System.ArgumentException' occurred in system.windows.forms.dll
Additional information: Cannot add or insert the item '02' in more than one place. You must first remove it from its current location or clone it.
That is the error when I am trying to view more than one records coming from my database. This is my chunk of code... please help me
VB.NET:
Dim strsql As String
Dim rs As New ADODB.Recordset
Dim a As Integer = 1
lvPartMain.Items.Clear()
strsql = "Select * from part_m_tab"
'Try
With rs
.Open(strsql, conn)
Dim lvItem As New ListViewItem
Do While Not .EOF
lvItem.Text = .Fields(0).Value 'm_partID
lvItem.SubItems.Add(.Fields(1).Value) 'm_partdesc
lvPartMain.Items.Add(lvItem)
.MoveNext()
Loop
End With
Last edited by a moderator: