Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
rtutus
Aged Yak Warrior
522 Posts |
Posted - 2006-01-19 : 20:43:08
|
Hi,I have a boolean check property of my check boxes in VB.NET. how can I send that value to SQL server, is there a boolean type in SQL server when I m designing the table.Thanks |
|
Srinika
Master Smack Fu Yak Hacker
1378 Posts |
Posted - 2006-01-19 : 20:53:26
|
vbUnchecked --> 0VbChecked --> 1 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2006-01-19 : 20:55:49
|
bitInteger data with either a 1 or 0 value.-----------------'KH' |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-01-20 : 01:48:00
|
bit can also be NULL MadhivananFailing to plan is Planning to fail |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2006-01-20 : 01:57:39
|
>> bit can also be NULL You are right.Then create the column as not null -----------------'KH' |
|
|
rtutus
Aged Yak Warrior
522 Posts |
Posted - 2006-01-20 : 08:35:11
|
Thanks guys. I guess there is no other alternative but doing the test and assigning either 0 or 1 values instead of just boolean type of VB checkbox.checked property.If checkbox1.checked=true then i=0 else i=1thanks |
|
|
RickD
Slow But Sure Yak Herding Master
3608 Posts |
Posted - 2006-01-20 : 08:59:13
|
AFAIK, VB use's 3 states as well.. |
|
|
Kristen
Test
22859 Posts |
Posted - 2006-01-20 : 10:36:43
|
I expect passing a native datatype of True/False to SQL Server will arrive at the SQL end as 1 or 0 - but I don't have VB here to check.Otherwise you'll need the IF ... THEN ... ELSE as you suggested, or a VB Function to "wrap" the task with - e.g. if you have several to do.Kristen |
|
|
RickD
Slow But Sure Yak Herding Master
3608 Posts |
Posted - 2006-01-20 : 10:41:00
|
Or just make the field non-nullable. |
|
|
rtutus
Aged Yak Warrior
522 Posts |
Posted - 2006-01-21 : 19:04:30
|
I ll do that, that works perfectly. thanks a lot. |
|
|
|
|
|