NewsBot
1
I have a method that checks whether a member variable of that class is valid or not (using the string IsNullOrEmpty method) and if it is null or empty throw an exceptuion with a sensible message describing the problem. However I don't know what type of exception to throw (it's not an argument so can't use the ArgumentNullExeption and FxCop is telling me not to use the Exception type), anyone got any ideas?
Private Function Save() As Boolean
******* If String.IsNullOrEmpty(_MemberVariable) Then
*********** Throw New Exception("Can not save itself without a valid member variable.")
******* End If
End
More...
View All Our Microsoft Related Feeds
Private Function Save() As Boolean
******* If String.IsNullOrEmpty(_MemberVariable) Then
*********** Throw New Exception("Can not save itself without a valid member variable.")
******* End If
End
More...
View All Our Microsoft Related Feeds