I have now managed to do this...(at last)
Protected Sub save_CheckedChanged(ByVal sender As Object, ByVal e As System.EventArgs)
Dim MyConnection As OdbcConnection
MyConnection = New OdbcConnection() 'declare new connection object
MyConnection.ConnectionString = " " 'database connect string
MyConnection.Open() 'open connection to database
Dim MyCommand As New OdbcCommand() 'declare new command object
MyCommand.Connection = MyConnection
Dim cID As Integer = 0
' Dim str As StringBuilder = New StringBuilder
Dim i As Integer = 0
Dim state As Integer
For i = 0 To GridView1.Rows.Count - 1
'Dim row As GridViewRow = GridView1.Rows(i)
Dim isChecked As Boolean = CType(GridView1.Rows(i).FindControl("save"), CheckBox).Checked
If isChecked Then
state = 1
Else
state = 0
End If
MyCommand.CommandText = "update support.support set save =? where id=?"
MyCommand.Parameters.Clear()
MyCommand.Parameters.Add(New OdbcParameter("@state", state))
MyCommand.Parameters.Add(New OdbcParameter("@id", GridView1.Rows(i).Cells(0).Text))
MyCommand.ExecuteNonQuery()
Next
MyConnection.Close()
MyCommand = Nothing
End Sub
All i need to do now is if a user checks a particular checkbox, it remains checked the next time they visit the page..
www.nursery-net.com