Last post Mar 11, 2011 12:44 AM by iGulfam
Mar 08, 2011 07:24 PM|danfa|LINK
I'm designing a form that retrieves boolean values that allow null. I'd like to convert these values to 'false' before binding to checkbox controls (using objectdatasource). I'm thinking to do this using the ObjectDataSource.Selected method but I'm not sure
how, and maybe there is a better way? The data from the ObjectDataSource is bound to a Formview.
Mar 09, 2011 05:04 AM|iGulfam|LINK
You can do this using your SQL Query. Your SQL Query will look like (Let us suppose Boolean Database field name is IsActive)
SELECT ISNULL(IsActive, 0) AS IsActive FROM [TABLE_NAME]
Now if IsActive field will be null then you will get the 0 (false)
Mar 09, 2011 09:53 PM|danfa|LINK
Works! Thank you!
Mar 11, 2011 12:44 AM|iGulfam|LINK
My pleasure! :)
Please don't forget to mark the post as answer which helped you