G
Guest
I have a custom class object which I'd like bound to text boxes etc on the form. All properties of the class look something like this
<System.ComponentModel.Description("Get/Set value associated with Phone column")>
Public Property Phone() As Strin
Ge
Me.CheckDisposed(
If (m_IsNullPhone = True) The
Throw New System.Data.StrongTypingException("Cannot get value because it is DBNull", Nothing
End I
Return m_Phon
End Ge
Set(ByVal Value As String
Me.CheckDisposed(
m_Phone = valu
m_Changed = Tru
m_IsNullPhone = Fals
End Se
End Propert
Whe I bind this property to a text box I get this error just after the form load
An unhandled exception of type 'System.Reflection.TargetInvocationException' occurred in system.dl
Additional information: Property accessor 'Phone' on object 'PPSS.Person' threw the following exception:'Cannot get value because it is DBNull
There seams to be no obvious way to intercept this error using the Binding object but can only catch it by using a high level error trap. The dataset object seams to handle this situation without raising an error so i guess there must be a way to do this.
Regard
<System.ComponentModel.Description("Get/Set value associated with Phone column")>
Public Property Phone() As Strin
Ge
Me.CheckDisposed(
If (m_IsNullPhone = True) The
Throw New System.Data.StrongTypingException("Cannot get value because it is DBNull", Nothing
End I
Return m_Phon
End Ge
Set(ByVal Value As String
Me.CheckDisposed(
m_Phone = valu
m_Changed = Tru
m_IsNullPhone = Fals
End Se
End Propert
Whe I bind this property to a text box I get this error just after the form load
An unhandled exception of type 'System.Reflection.TargetInvocationException' occurred in system.dl
Additional information: Property accessor 'Phone' on object 'PPSS.Person' threw the following exception:'Cannot get value because it is DBNull
There seams to be no obvious way to intercept this error using the Binding object but can only catch it by using a high level error trap. The dataset object seams to handle this situation without raising an error so i guess there must be a way to do this.
Regard