It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming Visual Basic Forum

listview checkbox

Moderator: dafunkymunky

listview checkbox

Postby lembayung1 on Mon Dec 31, 2007 8:30 am

this my code for listview checkbox...ive compiled and theres no error but all the data are not saved to my database

Code: Select all
For i = 1 To ListView3.ListItems.Count
       
        If ListView3.ListItems(i).Tag = "" And ListView3.ListItems(i).Checked = True Then
           
            sql = "insert into studentcourse ( peid,pengkod, bioid ) " & _
                  "values ( " & _
                  "'" & ListView3.ListItems(i).SubItems(1) & "', " & _
                  "'" & holdPENG & "')"
           
            db.Execute sql
           
        ElseIf ListView3.ListItems(i).Tag <> "" And ListView3.ListItems(i).Checked = True Then
           
            sql = "update studentcourse set " & _
                  "peid = '" & ListView3.ListItems(i).SubItems(1) & "', " & _
                  "pengkod= '" & holdPENG & "' " & _
                  "where peid = " & ListView3.ListItems(i).Tag
                 
            db.Execute sql
           
        ElseIf ListView3.ListItems(i).Tag <> "" And ListView3.ListItems(i).Checked = False Then
           
            sql = "delete from studentcourse where peid = " & ListView3.ListItems(i).Tag
           
            db.Execute sql
           
        End If



why is it so?
lembayung1
 
Posts: 2
Joined: Mon Dec 31, 2007 8:21 am

Who is online

Users browsing this forum: No registered users and 1 guest