HII,
i have a column in sql srver 2000 of data type bit.I have a checkbox in my page. i want to assign bit value to the column when the check box is checked and un checked,but i am getting errors when assigning true /false to the column.
greeny_1984
14
Posting Whiz
Recommended Answers
Jump to PostDatatype bit takes the value 0 or 1.....if true then 1
if false then 0
Jump to Postyes this is because.......it consist only true or false.....if 1 then true and if 0 then false
ur code must b like this
if (facultychecked.Checked == true)
{
anndept.announceToFaculty =1;
}
else
{
anndept.announceToFaculty =0;
}
AnnouncementManager.CreateAnnouncement(anndept);
}if u pass 1 (or greater than 1)to ur …
Jump to Postu can not assign 1 or 0 to a bool type variable.......
use Int type variable......and then assign 1 or 0
Jump to Postdo this thing.....take one int type variable....
Int32 i;
if (facultychecked.Checked == true)
{
i =1;
}
else
{
i=0;
}and now u have ur value in "i" ....insert the value of "i" in ur bit type column of ur table....
Jump to Post"anndept.announceToFaculty " this function is of bool type change this function dear.........
change this function dear........
All 19 Replies
btech_Saurabh
0
Light Poster
greeny_1984
14
Posting Whiz
btech_Saurabh
0
Light Poster
greeny_1984
14
Posting Whiz
btech_Saurabh
0
Light Poster
greeny_1984
14
Posting Whiz
btech_Saurabh
0
Light Poster
greeny_1984
14
Posting Whiz
btech_Saurabh
0
Light Poster
greeny_1984
14
Posting Whiz
btech_Saurabh
0
Light Poster
SheSaidImaPregy
28
Veteran Poster
greeny_1984
14
Posting Whiz
fatihpiristine
SheSaidImaPregy
28
Veteran Poster
ericstenson
5
Posting Whiz in Training
Team Colleague
greeny_1984
14
Posting Whiz
SheSaidImaPregy
28
Veteran Poster
greeny_1984
14
Posting Whiz
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.