checkboxes in query structure

G

Guest

I have the following in by web form code behind and it says that "operator
'&' is not defined for types 'String' and
'System.Web.UI.WebControls.checkbox'. How do you pass the value of a
checkbox to a query string? The example below was attempting to use a string
variable 'check' and checked1' for values of the checkboxes but with the
variables in the query I get same error but
'System.Web.UI.WebControls.textbox' instead. This insert query eventually
will take info from several check boxes. Thank you.

strsqlInsert2 = "insert into tblinfo (nameID, intakedate,
static99,SignedContract,DateContractSigned,ProbationViolation," & _
"
ProbationViolationDate,PrematureTermination,TerminationDate,TerminationReason) values (" & intname & ", '" & txtIntakeDate.Text & _
"', '" & txtStatic99.Text & "', '" & checked & "', '" &
txtDateSigned.Text & "', '" & txtProbationViolation & "', '" &
txtDateOfViolation & _
"', '" & checked1 & "', '" & txtTermDate.Text & "', '" &
txtTermReason.Text & ")"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top