If I assign the value in the textbox to the variable vUser, the check of HasChanges fails; even though the msgbox shows the correct value for vUser.

If I assign the value of vUser in code to something ex. "Hello" Then the HasChanges passes and the rest of the code runs.

Any help is appreciated.

Dim vUser As String
Dim vDist As String
Dim vCarrier As String
Dim Ret As Integer

Try

vUser = Me.TextBox2.Text
vDist = TextBox3.Text
vCarrier = TextBox4.Text
MsgBox(vUser)
TextBox2.Text = vUser

mydataset.Tables("tblcarrier").Rows(0).Item("Name") = vUser
Dim Dt As DataTable = mydataset.Tables("tblcarrier")
Dim NewDt As DataTable = Dt.GetChanges(DataRowState.Modified)




If Not mydataset.HasChanges(DataRowState.Modified) Then Exit Sub
' Create temporary DataSet variable.
Dim xDataSet As DataSet
' GetChanges for modified rows only.
xDataSet = mydataset.GetChanges(DataRowState.Modified)
' Check the DataSet for errors.
If xDataSet.HasErrors Then
' Insert code to resolve errors.
End If
MsgBox("made it3")
' After fixing errors, update the data source with the DataAdapter
' used to create the DataSet.
adpCarriers.Update(xDataSet, "tblcarrier")
MsgBox("Made it4")

Catch ex As Exception
System.Diagnostics.Debug.WriteLine(ex.Message & "l " & ex.StackTrace)
'Finally
conn.Close()
End Try
End Sub