Reputation: 37
I'm trying to add data into my Access database in Visual Basic, but I encount this error when I try to run my code:
Error 1 'Update' is not a member of 'GestiuneStudenti.Gestiune_StudentiDataSetTableAdapters.Gestiune_StudentiTableAdapter'. C:\Users\User\Documents\Visual Studio 2013\Projects\GestiuneStudenti\GestiuneStudenti\Form1.vb 64 13 GestiuneStudenti
Here is a sample of my code
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
Try
Gestiune_StudentiBindingSource.EndEdit()
Gestiune_StudentiTableAdapter.Update(Gestiune_StudentiDataSet.Gestiune_Studenti)
MessageBox.Show("Intrarea a fost adaugata cu succes")
Catch ex As Exception
MessageBox.Show("Eroare la adaugarea intrarii")
End Try
My database has 3 tables, 2 with primary key, and the third one with the primary keys from the other 2 tables as foreign key.
Thanks
Upvotes: 1
Views: 1396
Reputation: 46
Solution:
Upvotes: 3
Reputation: 17
If you want to update a dataset you only need thses
Gestiune_StudentiTableAdapter.Update(Gestiune_StudentiDataSet)
I hope it help
Upvotes: 1