468,139 Members | 1,451 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,139 developers. It's quick & easy.

inserting checkbox values to the database

hi,
In my application i have one checkbox when ever i am entering values to the page it has to store the values into the database table using insert statement , remaining values r inserting except checkbox value, i dont know in sql server 2005 which data type i have to use for that column to insert the checkbox checked values please reply me its very urgent
Aug 31 '07 #1
7 2042
Kermit
16
if using OleDB OleDbType.Boolean should work :)
for SQL try SqlDbType.Bit
Aug 31 '07 #2
if using OleDB OleDbType.Boolean should work :)
for SQL try SqlDbType.Bit





hi thank u
it is inserting the values but it is storing 1 in that column instead of true how can change it to true
Aug 31 '07 #3
Shashi Sadasivan
1,435 Expert 1GB
Could you please make sure that the field which is supposed to be boolean is actually a bit, rather than an int or something?
Aug 31 '07 #4
Could you please make sure that the field which is supposed to be boolean is actually a bit, rather than an int or something?

hi
in this i want boolean type only what i said is it is storing the values as 0's and 1's instead of that shall i change i in to the form of true and false
Aug 31 '07 #5
Kermit
16
The SqlDBType.Bit may store 0, 1, or Null values to the database (see tooltip). Basicly it is the same, but maybe sql stores true/false as 0's or 1's?
Aug 31 '07 #6
The SqlDBType.Bit may store 0, 1, or Null values to the database (see tooltip). Basicly it is the same, but maybe sql stores true/false as 0's or 1's?

thank u
i am getting like that only yes it is storing in the form of 0's and 1's
and i have one more doubt regarding Contact number ,it is U.S Phone number it is having ' - ' symbols in between numbers so for this which datatype i can use
i used integer but it is treating like minus symbol................
Aug 31 '07 #7
Kermit
16
use varchar with an input mask (something like ie. 000\-000\-000;0;)
Aug 31 '07 #8

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

1 post views Thread by J Talbot | last post: by
1 post views Thread by gcdp | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.