By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,870 Members | 1,189 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,870 IT Pros & Developers. It's quick & easy.

How do I get the value of a checkbox?

P: n/a
I am trying to input the value of a checkbox in a database. If it it
true I want 1, false 0. I know I can write a function to do this, but
thought that wasn't right. Comments welcome. Thanks.

Nov 19 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Is this an SQL Server Bit column? if so, assigning true/false to your
command's parameter should work.

If it's access, you might need to change the Yes/No format to True/False.

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
<ne***********@gmail.com> wrote in message
news:11*********************@g47g2000cwa.googlegro ups.com...
I am trying to input the value of a checkbox in a database. If it it
true I want 1, false 0. I know I can write a function to do this, but
thought that wasn't right. Comments welcome. Thanks.

Nov 19 '05 #2

P: n/a
Not sure what you are telling me to do. I am using MySQL and it has a
1 or 0, so I have to change the checked to that.

Nov 19 '05 #3

P: n/a
Karl asked, whether the datatype of this column in SQL Server table is
BIT
if so, you could directly assign the value of the CheckBox.Checked
property

if not, you need code like

if (CheckBox.Checked)
paramvaluefordb= "1";
else
paramvaluefordb= "0";

Nov 19 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.