|
-
Nov 16th, 2009, 10:50 AM
#1
Thread Starter
Fanatic Member
Getting the autonumbers value in VB.NET 2008
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|