I am my application for some reason I have two numbers of 5 digits.
The following code gives you a brief description.
string s = "00001"; // Initially stored somewhere. //Operation start string id = DateTime.Now.ToString("yy") + DateTime.Now.AddYears(-1).ToString("yy") + s; //Operation end //Increment the value of s by 1. ie 00001 to 00002
This can be done easily by converting the value of s to int and incrementing it by 1, but after all I have to keep the increment of s in a 5-digit value, so that it is "00002" .
That think, give me pain ...
source share