//connection here and declaration of variable
Dim i As Integer
Dim chk As CheckBoxList
chk = CType(Me.FindControl("chkBx1"), CheckBoxList)
For i = 0 To chk.Items.Count - 1
If chkbx.Items(i).Selected Then
cmd.Parameters.AddWithValue("@OptionID", chk.Items(i).Value)
cmd.ExecuteNonQuery()
cmd.Parameters.Clear()
End If
Next
I get the error message: Object reference not set to an instance of an object. Please assist.I need to insert each selected value to its column in the db.
Edited by Dogstopper:

New Topic/Question
Reply




MultiQuote





|