Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Mar 11, 2011 04:44 AM by iGulfam
Mar 08, 2011 11:24 PM|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 09:04 AM|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 10, 2011 01:53 AM|LINK
Works! Thank you!
Mar 11, 2011 04:44 AM|LINK
My pleasure! :)
Please don't forget to mark the post as answer which helped you