Click here to Skip to main content
15,946,525 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
I have web form in asp .net to take input and
I have upload files as well in the form which are also saving in hard disk before webpage is saved.

My question how to save both with unique id, because many user can hold the form and save it.

What I have tried:

I tried to take the last id and use in the form

var lastid = (from t in ctx.Tasks
orderby t.ID descending
select t.ID).FirstOrDefault();

int k = lastid + 1;
string gin = k.ToString("D8");
string tasknumber = "TSK" + gin;

but when user hold the form both save in same number.
Vincent Maverick Durano 18-Aug-16 7:35am    
Why not generate a GUID and use that as your unique ID instead?

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