Checkboxlist into database

Hello folks.
I’ve seen this done a few times in C# but I’m afraid my knowledg doesn’t extend into converting this to I’m simply looking to examine a checkboxlist and then send the checked values to a database table. It’s the actual inserting into the database that i’m not sure what to do with.

Can anyone help please?

Here is some code…

Protected Sub InsertButton_Click(ByVal sender As Object, ByVal e As System.EventArgs)
        Dim ckbox As ListItem
        Dim ckboxlist As CheckBoxList
        Dim profile_id_int As TextBox

        ckboxlist = CType(Me.FormView1.FindControl("Checkboxlist1"), CheckBoxList)
        profile_id_int = CType(Me.FormView1.FindControl("staff_payroll_int"), TextBox)

        For Each ckbox In ckboxlist.Items
            If ckbox.Selected = True Then
                'insert record in profile_skill_link table
                    'Create a New Connection for the Stored Procedure 
                    Dim myConnection As New Data.SqlClient.SqlConnection(Me.SqlDataSource3.ConnectionString)
                    Dim mysql As String
                    mysql = "Insert into staff_profile_string_link(staff_profile_int, skill_id_int) values('" + ckboxlist.SelectedItem.Text + "','" + profile_id_int.Text + "';)"
                    'insert into database here

                Catch ex As Exception
                    Response.Redirect("~/GenericErrorPage.aspx", False)
                End Try
            End If

    End Sub

I really don’t understand the problem, but the code you posted needs a sqlcommand object which will need to be executed for the insert

no takers?
anyone help at all please?


Yeah, good catch chieftain. Can you supply the rest of your code (the commented out) to accurately help you.