Values of textbox are not being saved in the following routine:

macupryk

Newcomer
Joined
Sep 27, 2003
Messages
21
Location
Canada
Values of textbox are not being saved in the following routine:

Function FillTextBox(ByRef TextBox As TextBox, ByVal Value As Object)
If Not IsDBNull(Value) Then
TextBox.Text = Value
Else
TextBox.Text = ""
End If
End Function


Private Sub EditForm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Poluate text box.
FillTextBox(txtAccountName, TOverride.Account_Name)
FillTextBox(txtPolicyNumber, TOverride.PolicyNumber)
FillTextBox(txtUserId, TOverride.ModifiedUID)

End Sub
 
What is TOverride in your above code and what data types are it's members? If you want to check for a null you may not need IsDBNull but rather compare to nothing e.g.
Visual Basic:
if not Value is nothing then

Also if you are using value types then they do not support the concept of nothing (null) anyway.
 
Back
Top