Click here to Skip to main content
15,911,132 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I have a requirement where in an application, whenever user creates a new instance, it should assign the number value automatically. For Example, If we fill some details and save. Later another person will create a new instance fill the details and save it. then, for the current instance it should the assign the Instance field value to 2 (as previous one is 1).
It should increment based on the previous value.

Please let me know the workflow or how to do it?

What I have tried:

I'm not sure on this how to link up these all thing into one. Any help will be appreciated and thanks in advance.
Posted
Updated 19-Jun-16 19:43pm
Comments
Maciej Los 20-Jun-16 2:16am    
What you mean by "user creates a new instance"? Instance of what: aaplication, object, ...?

1 solution

Generally speaking, don't.
It's possible, but in most cases it's a bad idea. I assume you are using a database of some form, and if so then you will find the capability built into the DB: duplicating that is a recipe for real problems once software gets into production. For a DB, see the SQL IDENTITY field: IDENTITY (Property) (Transact-SQL)[^]
 
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