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.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Suthish NairPosted Oct 1, 2010, 11:54 AM
did you tried what i post...
JurePosted Oct 1, 2010, 11:21 AM
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.
Dharmesh SharmaPosted Oct 1, 2010, 6:47 AM
u not understand my proble
i wan to like this
00001
00002
00003.
.
.
.
.
.
..
00010
..
.
.
.
00100
like this
give any idea
Suthish NairPosted Oct 1, 2010, 6:06 AM
Gomathi PalaniswamyPosted Oct 1, 2010, 6:00 AM
just get as id.length it will return digit count.
Dharmesh SharmaPosted Oct 1, 2010, 5:33 AM
this will not increase
n if u do then i get another idea to how to count degite of id
Gomathi PalaniswamyPosted Oct 1, 2010, 5:29 AM
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;