Click here to Skip to main content
16,012,223 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi everyone,

in my aspx page user is creating a request and when the request is created a request_id is generated automatically in databse..i want to retreive tht particular request_id and display it on the same web page..

plz help...its urgent...
Posted
Updated 7-Feb-11 21:37pm
v2
Comments
Sunasara Imdadhusen 8-Feb-11 3:37am    
Dont use URGENT word!
RKT S 8-Feb-11 4:24am    
fine

1 solution

There are a few ways to do it, but only one reliable one: search the database for the info you have just entered.

There are a few ways you can retrieve the last created ID, but in a multi-user system they are not safe to use, as sometimes, a different user will get in just after you, and before you get the info. Intermittent bugs are no fun to find...

If you really need to get the ID from an automatically generated database field, then I would recommend not using automatically generated database fields in the first place. Use a GUID instead, as you then generate it and know exactly which record you are looking at.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900