I'm trying to read back the autonumber of the last record which was inserted by my program into an Access database using VB.NET 2008 Express.

This is the table adaptor save code:

Me.Validate()
Me.TblTablenameBindingSource.EndEdit()
Me.TableAdapterManager.UpdateAll(Me.DatabasenameDataSet)

I need to follow this up with code to get the autonumber primary key of the record that was created by the code. If another user creates a record at the same time, it should not return that value but rather the correct one. The SQL that is used to get the last autonumber is SELECT @@IDENTITY but how would you do this when you're using a table adaptor?

Robert