Why Doesnt Databinding update the database?

  • Thread starter Thread starter Lynxbci
  • Start date Start date
L

Lynxbci

Guest
Hello,

I followed tutorial on creating a Database and it has all gone very well, and i have 2 tables that are showing in my datasource. I dragged one onto a form and it created a datagridview and a databinding control at the top of the screen.

I then ran the project (F5) and voila my data appears in the datagrid.

I then click + to add a new record, and a newline is generated, i add the new line and press save !!!

It does not save the data. I close the project and check that table and no the new record is lost.

I tried to update one field and press save and nothing once again.

The code is all pre generated and i have not amended or changed anything........ so why does it not save

Public Class Form1
Private Sub CustomersBindingNavigatorSaveItem_Click(sender As Object, e As EventArgs) Handles CustomersBindingNavigatorSaveItem.Click
Me.Validate()
Me.CustomersBindingSource.EndEdit()
Me.TableAdapterManager.UpdateAll(Me.SampleDatabaseDataSet)

End Sub

Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
TODO: This line of code loads data into the SampleDatabaseDataSet.Customers table. You can move, or remove it, as needed.
Me.CustomersTableAdapter.Fill(Me.SampleDatabaseDataSet.Customers)

End Sub
End Class


Thank you

Continue reading...
 
Back
Top