VB2005 Database Null Exceptions
Posted on 2007-07-20
Hi - my program is crashing when it reaches this code:
If IsNothing(Formula.Comments) Then
txtOut.Text += "There are no formula specific notes."
txtOut.Text += Formula.Comments
Formula.Comments is a field in an Access Database and the IsNothing line is where it dies. It crashes to (myform).designer,vb at line:
Throw New System.Data.StrongTypingException("The value for column 'Comments' in table 'tblFormulas' is DBNull.", e)
StrongTypingException was unhandled.
I thought the IsNothing function prevented this error? I want to test for a null and do something about it - not crash :)