B
Brian
I have been able to Add a new row to a dataset, and then save the new
row back to the data source. The problem is, after the data source is
updated, all the text fields in the form clear. Any ideas?
Here's my code:
Private Sub mnuAddNewPerson_Click(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles mnuAddNewPerson.Click
...
Dim personRow As DataRow
...
ds.Tables(0).Clear()
personRow = ds.Tables(0).NewRow
ds.Tables(0).Rows.Add(personRow)
...
End Sub
***
Private Sub mnuSave_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles mnuSave.Click
...
cmPeople.EndCurrentEdit()
daPersonMain.Update(ds, "PersonBasic")
...
End Sub
row back to the data source. The problem is, after the data source is
updated, all the text fields in the form clear. Any ideas?
Here's my code:
Private Sub mnuAddNewPerson_Click(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles mnuAddNewPerson.Click
...
Dim personRow As DataRow
...
ds.Tables(0).Clear()
personRow = ds.Tables(0).NewRow
ds.Tables(0).Rows.Add(personRow)
...
End Sub
***
Private Sub mnuSave_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles mnuSave.Click
...
cmPeople.EndCurrentEdit()
daPersonMain.Update(ds, "PersonBasic")
...
End Sub