I am trying to do two things for a test app:<BR>1) Populate a CheckboxList webcontrol by loading a list of subject names (for the DataTextField) and subject codes (for the DataValueField).<BR>2) Respond to user selection by inserting their boolean values based on checked vs. unchecked boxes. I have a SQL Server table with a lot of columns of data type bit. All of the columns are named after different subject codes (such as HSmath, HSast, etc.)<BR><BR>The first step I can do fine - but the second I am have trouble with. How would I write looping code that would insert the status of each checkbox into a field with names after the checkbox&#039;s value? Meaning, how would I get HSmath&#039;s checked status to be inserted into the HSmath field in my table, and then the HSast&#039;s checked status to be inserted into the HSast field, and so on.<BR><BR>I have included my code thus far (removing unnecessary markup), including my looping code for printing out results on the screen (screenshot attached) - obviously this is what I&#039;d replace with my database code. Any help is appreciated.<BR><BR>Dim strConn as string = ConfigurationSettings.AppSettings("ConnString")<BR ><BR>Sub Page_Load(sender AS Object,E as EventArgs) <BR> If Not IsPostBack Then<BR> Dim conPubs As SqlConnection<BR> Dim cmdSelect As SqlCommand<BR> Dim dtrSubjects As SqlDataReader<BR><BR><BR> conPubs = New SqlConnection(strConn)<BR> cmdSelect = New SqlCommand( "Select * From tutors_subjectcodes order by Subject", conPubs )<BR> conPubs.Open()<BR> dtrSubjects = cmdSelect.ExecuteReader()<BR><BR> check1.DataSource = dtrSubjects<BR> check1.DataTextField = "Subject"<BR> check1.DataValueField = "subjectcode"<BR> check1.DataBind()<BR><BR> dtrSubjects.Close()<BR> conPubs.Close()<BR> End If<BR>End Sub<BR><BR>Sub btnStep2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)<BR> Dim msg As String<BR> Dim li As ListItem<BR> msg = ""<BR> For Each li In check1.Items<BR> If li.Selected = True Then<BR> msg = msg & "&#060;li&#062; " & li.Text & "&nbsp;(" & li.Value & ")&#060;/li&#062;<BR>"<BR> End If<BR> Next<BR> lblSubjects.Text = "<BR>&#060;b&#062;Selected:<BR>&#060;/b&#062;&#060;ul&#062;" & msg & "&#060;/ul&#062;"<BR>End Sub<BR><BR><BR> &#060;asp:checkboxlist id="check1" runat="server" RepeatColumns="4"&#062;&#060;/asp:checkboxlist&#062;<BR> <BR><BR> &#060;asp:Button id="btnStep2" onclick="btnStep2_Click" runat="server" Text="Submit"&#062;&#060;/asp:Button&#062;<BR> <BR><BR> &#060;asp:label id="lblSubjects" runat="server"&#062;&#060;/asp:label&#062;