I write this code for insert checklistbox value in database.
Dim qry As String = ""
Dim usr As String = "nuwan"
Dim list As ListItem
For Each list In CheckBoxList1.Items
If (list.Selected) Then
qry += "insert into privilage (user,page) values('" + usr + "','" + list + "')"
End If
Next
If (qry <> "") Then
Dim sqlcmd As SqlCommand = New SqlCommand(qry, sqlcon)
sqlcmd.CommandType = CommandType.Text
sqlcon.Open()
sqlcmd.ExecuteNonQuery()
sqlcon.Close()
End If
I got following error. how I fix it.Please help me
error BC30452: Operator '+' is not defined for types 'String' and 'System.Web.UI.WebControls.ListItem'.
Rathnayake