How to store values from checked checkboxlists~c#
Visual Studio 2005 [C#], MS SQL 2005 database
I am working on a survey using VS 2005, connected to a MS SQL 2005 database. Using ASP.NET2.0 controls (textbox, checkboxlist, dropdownlist). A submit button would run "SqlDataSource1.Insert();" to insert user data into the connected database.
Using the control ID as the formfield name, I have managed to pass values entered in textboxes, or selected via dropdownlist into the database.
<InsertParameters>
<asp:formparameter Name="businessName" formfield="BusinessName_TextBox"
Type="String" />
<asp:formparameter Name="mainContact"
formfield="MainContact_TextBox" Type="String" />
<asp:formparameter Name="email"
formfield="EmailAddress_TextBox" Type="String" />
<asp:formparameter Name="Q1"
formfield="Part1Q1_DropDownList" Type="String" />
~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~
But I do not know how to store values from the checkboxlist. Within the database I have created fields for all available options. (E.g Q2a, Q2b, Q3c) and the aim is to pass the checked values into its corresponding fields in the database. So that If question 2 was a checkboxlist. When someone checked 1st box, its corresponding value are stored in 'Q2a'.
I am using C#, could anyone assist? Many thanks in advance,
kind Regards,
William
|