| | |
how to convert true/false to bit
Please support our ASP.NET advertiser: Intel Parallel Studio Home
Thread Solved |
when iam assigning false to the coulmn iam getting error
The name 'False' is not permitted in this context. Only constants, expressions, or variables allowed here. Column names are not permitted.
here is my code
if (facultychecked.Checked == true)
{
anndept.announceToFaculty =true;
}
else
{
anndept.announceToFaculty =false;
}
AnnouncementManager.CreateAnnouncement(anndept);
}
The name 'False' is not permitted in this context. Only constants, expressions, or variables allowed here. Column names are not permitted.
here is my code
if (facultychecked.Checked == true)
{
anndept.announceToFaculty =true;
}
else
{
anndept.announceToFaculty =false;
}
AnnouncementManager.CreateAnnouncement(anndept);
}
yes 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 bit datatype column....then it make is as True
if u pass 0 to ur bit datatype column in sqlserver then....it make it as false.....
Pass (1 or 0 ) value.....it automatically....insert True or 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 bit datatype column....then it make is as True
if u pass 0 to ur bit datatype column in sqlserver then....it make it as false.....
Pass (1 or 0 ) value.....it automatically....insert True or False
![]() |
Similar Threads
- SQL insert help!! (VB.NET)
- convert lower case letters to uppercase and vice-versa (C++)
- Help with Creating a Command Line Menu (C++)
- Array problem (C#)
- HELP!!! Weird problem... (C++)
- Truth Table (Computer Science)
- Conversion and searching with a string help (C++)
- I've got Trojan.Holax... is this bad? (Viruses, Spyware and other Nasties)
- not-a-virusadware (Viruses, Spyware and other Nasties)
- modifying all of the instances in an array at once (Java)
Other Threads in the ASP.NET Forum
- Previous Thread: .net nutch.
- Next Thread: Hi Help me i am new to asp.net
| Thread Tools | Search this Thread |
.net 2.0 activexcontrol advice ajax alltypeofvideos application asp asp.net bc30451 bottomasp.net box browser button c# c#gridviewcolumn checkbox click commonfunctions confirmationcodegeneration css dataaccesslayer database datagridview datagridviewcheckbox datalist deadlock development dgv dropdownlist dynamically edit expose feedback fileuploader fill flash form formatdecimal forms formview grid gridview gudi homeedition hosting iframe iis javascript jquery listbox login microsoft mono mouse mssql multistepregistration news numerical objects opera panelmasterpagebuttoncontrols parent radio redirect registration relationaldatabases reportemail rotatepage save schoolproject search security select silverlight smartcard smoobjects software sql-server sqlserver2005 suse textbox tracking unauthorized validation vb.net video videos view virtualdirectory vista visualstudio web webapplications webdevelopemnt webprogramming webservice xml xsl youareanotmemberofthedebuggerusers





