Hello World
I have this code:
[CODE=vb .net]Windows.Forms.C ursor.Current = Cursors.WaitCur sor
Call Main.SetConnect ion()
For i = 1 To frmSchedules.lv wSchedules.Item s.Count
Command = New OleDbCommand("S elect * From Subjects Where SubjectCode " & _
"Not In ('" & frmSchedules.lv wSchedules.Item s(i).SubItems(1 ).Text & _
"')", dbConnection)
Command.Command Type = CommandType.Tex t
Data = Command.Execute Reader
lvwSubjects.Ite ms.Clear()
While Data.Read
Item = lvwSubjects.Ite ms.Add(Data(0))
Item.SubItems.A dd(Data(1))
End While
Next i
Data.Close()
Main.CloseConne ction() 'Close Connection
Windows.Forms.C ursor.Current = Cursors.Default[/CODE]
Everytime I execute this it fails me. and it says InvalidArgument =Value of '9' is not valid for 'index'. My main purpose is to display only the subjects in a listview1 that are not present in a listview2. Waiting for your replies : )
Rey Sean
I have this code:
[CODE=vb .net]Windows.Forms.C ursor.Current = Cursors.WaitCur sor
Call Main.SetConnect ion()
For i = 1 To frmSchedules.lv wSchedules.Item s.Count
Command = New OleDbCommand("S elect * From Subjects Where SubjectCode " & _
"Not In ('" & frmSchedules.lv wSchedules.Item s(i).SubItems(1 ).Text & _
"')", dbConnection)
Command.Command Type = CommandType.Tex t
Data = Command.Execute Reader
lvwSubjects.Ite ms.Clear()
While Data.Read
Item = lvwSubjects.Ite ms.Add(Data(0))
Item.SubItems.A dd(Data(1))
End While
Next i
Data.Close()
Main.CloseConne ction() 'Close Connection
Windows.Forms.C ursor.Current = Cursors.Default[/CODE]
Everytime I execute this it fails me. and it says InvalidArgument =Value of '9' is not valid for 'index'. My main purpose is to display only the subjects in a listview1 that are not present in a listview2. Waiting for your replies : )
Rey Sean
Comment