| | |
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 3.5 ajax alltypeofvideos appliances asp asp.net beginner box browser businesslogiclayer button c# cac checkbox class commonfunctions compatible content contenttype control countryselector courier dataaccesslayer database datagrid datagridview datalist deployment development dgv dialog dropdownlist dropdownmenu dynamic dynamically edit embeddingactivexcontrol fileuploader fill findcontrol flash flv gridview gudi iis javascript list listbox login menu microsoft mouse mssql nameisnotdeclared news novell numerical opera order panelmasterpagebuttoncontrols problem radio ratings redirect registration relationaldatabases reportemail schoolproject search security serializesmo.table sessionvariables silverlight smoobjects software sql sql-server sqlserver2005 ssl tracking treeview validatedate validation vb.net videos vista visual-studio visualstudio vs2008 web webapplications webarchitecture webdevelopment webprogramming webservice wizard xsl youareanotmemberofthedebuggerusers





