
Originally Posted by
crazyfool
ok so far I have made the database in vb (.mdf database) and I think that when i click on my save button it seems the changes made to the database are saved to the dataset... but then when i close the form the changes are lost as they aren't applied to the database itself... I've been googling for days now and i cant find a simple way to do this... I think i have to write my own update methods but I have no idea how or if this is even how to do it.... does anybody have any ideas...plz...
btw its vb.net
This is how I've done it in past using a dataset and a OleDbDataAdapter
myDS is the dataset and da is the OleDbDataAdapter
Code:
If myDS.HasChanges Then
Try
myDS.Tables(0).GetChanges()
da.Update(myDS.Tables(0))
Catch ex As Exception
myDS.RejectChanges()
MessageBox.Show(ex.ToString)
End Try
End If
it should give you some pointers.