I am having trouble populating the DataTextField of a CheckBox List with data from more than one field of a database. If I only use one field it works fine, but as soon as i add a second I receive and error. Here is a sample of the code (using vb
strSQL = ""
strSQL += " select id, firstname, lastname"
strSQL += " from approvers"
objConn = New SqlConnection(strConn)
objAdapter = New SqlDataAdapter(strSQL, objConn)
cblApprovers.DataSource = objDS.Tables("approver").DefaultView
cblApprovers.DataTextField = "lastname" & ", " & "firstname"
cblApprovers.DataValueField = "id"
If I just use "firstname" or "lastname" it run fine. I am hoping to populate a checkbox list that will show like this
Can you please assist?