belle@twookies.com
New member
- Joined
- Jul 6, 2010
- Messages
- 3
- Programming Experience
- Beginner
When I try to add a new record to my bindingsource it seems to work fine and tells me that I have updated one new record. But when I come back later, the record doesn't exist in the database. The database key field is an autoincrementing field - that may be my problem? If so any ideas on how to get around this?
My command to add a new record
MoviesBindingSource.AddNew()
this creates blank fields on my form1, (the primary key shows as -1) then when you fill in the form and save the record with the following command
Validate()
MoviesBindingSource.EndEdit()
Dim i = MoviesTableAdapter.Update(MoviesDataSet.Movies)
MsgBox(" Records updated in Movies table = " & i)
It shows one record has been updated.
If you view the records on the form, the new record appears to exist in the datatable
But if you close the program, and restart it, the new record doesn't exist in the database.
Also if you preview the records in the database (MoviesDataSet.xsd) in the solution explorer, the new record doesn't exist.
I also get no errors in the immediate window, so I don't think I have any conversion type errors.
Any ideas?
My command to add a new record
MoviesBindingSource.AddNew()
this creates blank fields on my form1, (the primary key shows as -1) then when you fill in the form and save the record with the following command
Validate()
MoviesBindingSource.EndEdit()
Dim i = MoviesTableAdapter.Update(MoviesDataSet.Movies)
MsgBox(" Records updated in Movies table = " & i)
It shows one record has been updated.
If you view the records on the form, the new record appears to exist in the datatable
But if you close the program, and restart it, the new record doesn't exist in the database.
Also if you preview the records in the database (MoviesDataSet.xsd) in the solution explorer, the new record doesn't exist.
I also get no errors in the immediate window, so I don't think I have any conversion type errors.
Any ideas?