Author: Chaplain Doug | Posted on: 8/13/2009 8:32:03 AM | Views : 411

 VWD 2008 Express.  Visual Basic.  SQL Server 2005.
I have a formview that is tied to a sqldatasource.  Some of the fields in the SQL table allow Null values.  In particular, I am getting an error when the formview comes up and tries to display to boolean (bit) field whose value is Null.  I get the following error:
Conversion from type 'DBNull' to type 'Boolean' is not valid. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.InvalidCastException: Conversion from type 'DBNull' to type 'Boolean' is not valid. Source Error: Line 334: <br /> Line 335: InviteLBW: Line 336: <asp:Che ...

Go to the complete details ...