hi
how to create a number like 00001 and increase one by one
in c#
i dont get idea for this
please help me
Loading
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Gomathi PalaniswamyRank #714 · 3.3K reputationPosted Oct 1, 2010, 1:29 AM EDT
Get the id by using get_ident command and keep "0000" as string and bind the ident value with the string.
string s = "0000"+identity;
Dharmesh SharmaRank #1,974 · 741 reputationPosted Oct 1, 2010, 1:33 AM EDT
this will not increase
n if u do then i get another idea to how to count degite of id
Gomathi PalaniswamyRank #714 · 3.3K reputationPosted Oct 1, 2010, 2:00 AM EDT
just get as id.length it will return digit count.
Suthish NairRank #92 · 22.8K reputationPosted Oct 1, 2010, 2:06 AM EDT
Dharmesh SharmaRank #1,974 · 741 reputationPosted Oct 1, 2010, 2:47 AM EDT
u not understand my proble
i wan to like this
00001
00002
00003.
.
.
.
.
.
..
00010
..
.
.
.
00100
like this
give any idea
JureRank #2,128 · 670 reputationPosted Oct 1, 2010, 7:21 AM EDT
for (int i = 0; i < 100000; i = i * 10 + 1)
{
Console.WriteLine(i.ToString("00000"));
}
outputs:
00000
00001
00011
00111
01111
11111
See this MSDN page.
Suthish NairRank #92 · 22.8K reputationPosted Oct 1, 2010, 7:54 AM EDT
did you tried what i post...