I am losing my mind. I can't figure this out. I have a dataset and a
textbox that is bound to it. I edit the textbox value and click a
button to submit the changes to SQL CE server. I call EndCurrentEdit(),
and then I check the value of HasChanges(). I always get a false. What
am I doing wrong?
Here is the trimmed down version of the code. Please don't worry about
the data adapter and changes to the DB. If I can get the HasChanges to
work, then I think the data adapter will also work.
------------Begining of Code------------
' In my form load
sqlCnn =3D New SqlCeConnection("Data Source=3D" & mPath & file & ";
Password=3D;")
sqlCnn.Open()
sqlCmdText =3D "Select * from TblClasses where termKeyID =3D 1
Order by class"
sqlCmd =3D New SqlCeCommand(sqlCmdText, sqlCnn)
da.SelectCommand =3D sqlCmd
sqlCmdBld =3D New SqlCeCommandBuilder(da)
da.UpdateCommand =3D sqlCmdBld.GetUpdateCommand
da.InsertCommand =3D sqlCmdBld.GetInsertCommand
da.DeleteCommand =3D sqlCmdBld.GetDeleteCommand
da.Fill(ds, "TblClasses")
TextBox1.DataBindings.Add("Tex=ADt", ds.Tables("TblClasses"),
"class")
' End of Form
' My Button even
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
TextBox1.BindingContext(ds).En=ADdCurrentEdit()
MessageBox.Show(ds.HasChanges(=AD))
End Sub
------------End of Code------------
I edit the text box, and click the button.
The messagebox.Show(ds.HasChanges(=AD)) always returns a false. I can't
get it work no matter what I do.=20
Please HEEEELP!