TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Administrator
Tech Writer
2.2k
1.5m
Getting your last saved record in database
Mar 21 2003 1:52 PM
Hi guys. When I insert a new record to my database, I need to grab the ID (identity/auto increment field) of that record RIGHT AWAY. What I have done in the past, is to run a query SELECT MAX(ID) FROM
right after I inserted the new record, but this can't be a fool-proof way of doing it. What if someone else inserts a new record before I run my SELECT MAX query? So, my question is: does anyone know of a better way? Is there any built-in functionality for this in ADO.NET? Thanks!
Reply
Answers (
4
)
How to Retrieve a ListviewItem
UserControl problem