Checking for DBNull throws a StrongTypingException
问题 I am using a dataset to pull data from a DB. One of the fields in a row is NULL . I know this. However, the following vb.net code throws a StrongTypingException (in the autogenerated get_SomeField() method in the dataset designer): If Not IsDBNull(aRow.SomeField) Then 'do something End If According to documentation and this question it should be fine. edit: If aRow.SomeField is DBNull.Value Then also returns the same error. Argh. 回答1: The difference is that in the related question it is