Hi
I want to insert multiple checkboxes into an sql table using asp.net. At the mment it only inserts the first value checked, so not sure if i am doing it the right way.
Part of the SQL code-----------------------------------------
strInsert = “Insert subscriptions(subscription) Values (@subscription)”
cmdInsert.Parameters.Add( “@subscription”, check.SelectedValue)
Replace Column with the name of your column field in your database table. Then add additional ones for each check box entry you need. I don’t think SelectedValue will work in this scenario. Then add your column(s) to the parameters collection of the command object.
It should be right…did you try it? If so, if it compiles and inserts properly, then it works. I usually use SqlDataSources in this environment instead of the code behind.