This is just a general question irrespective of database architecture. I am maintaining an ASP.NET web application. The structure is such that,
Say on 'Add a new employee' webform
- The primary key (or the record id to
be saved with) is initially loaded on form
load event & displayed as a label
- So when the form loads, the record id to save with is shown to the user
Positives:
- End user already knows what the id/serial of the form is (even before he saves the form)
- So on form save when he is directed to gridview screen (with all entries) he can search recrods easily (although the most recent one is at the top anyway)
Negatives:
- If he does not save the form, say he just cancels after loading the data entry form, the id/key initially fetched is wasted (in my case it is a sequence field fetched on form load from database)
What do you guys do in these scenarios ? Which approach would you recommend for 'web applications'? And how to facilitate the user with a different approach ? Is our current approach recommended (To me,it wastes the ids/sequence from database)