I am having a problem adding new records to a SQLCE table.
I have written my data-adapter insert command as appropriate.
I then added a 'new' button and added the following code to it:
Sub NewRecord()
Dim cMan as CurrencyManager
Dim dt as datatable = Nothing
dt = ds.Tables("tblName")
cMan = CType(Me.BindingContext(dt),CurrencyManager)
cMan.AddNew
End Sub
The user can select a record using a bound dropdown, and then fills in the
relevant data for a record using bound combo and textboxes.
When the above executes, a new line is inserted into the record selection
combo which is blank. It should be the int identity value from the
underlying table. I thought that doing this would move the current record to
the newly inserted record. However, it doesnt. If I attempt to save changes,
which calls the Data-Adapter.Update method, no errors are raised, but the
new record is not inserted.
Any suggestions what might be going wrong?
--
Cheers,
James Goodman
|