View Single Post
  #2 (permalink)  
Old October 24th, 2009, 09:42 PM
alliancejhall alliancejhall is offline
Friend of Wrox
 
Join Date: Nov 2007
Location: Central Florida, USA.
Posts: 207
Thanks: 2
Thanked 15 Times in 15 Posts
Default It's due to null...

If you have a field in your db that has no value (null) you code doesn't know what to do with it. Since the check setting requires a boolean (True False) it can't interpret a null. One way around this is to set a default when adding a row to the database. If there is no value chosen OT set it to True and same for PT...

For the rows you already have in the DB you will have to handle them so your code won't bomb out. Assuming you are using MSSQL you can use an isnull statement. Basically it looks like this:

Code:
Select Grade, isnull(OT, 'True') as OT, isnull(PT,'True') as PT from myTable
I hope this helps! Also please try not to double post. We will see it the first time you post it. 2 of the same thing just boggs things down.
__________________
Jason Hall

Follow me on Twitter @jhall2013
Reply With Quote