B
bthumber
I had an application method that counts the total number of records that like
for example buffal. From 0-99 things work find, see the code:
int count = (int)Session["hostCount"];
if ((count >= 0) && (count <= 98))
{
count++;
SequenceNumbers sn = new SequenceNumbers();
lblSubStr.Text = sn.GetNumberSequence(count);
}
// first record would be buffal01, last record buffal99, next record should
be buffala1.
If that test fails the sequence of characters and numbers runs, a1, a2,
a3...z9. At this point there are 99 records in the database and the "count"
is 99. If I start the count at 99 then increment if by it will be 100 and the
sequence will start at l2, so I need to reset the count to start at 0 so that
the next record buffala1, see code:
else if ((count >= 0) && (count <= 233))
{// got to increment this somewhere
count = 0;
AlphaNumberSeq ans = new AlphaNumberSeq();
lblSubStr.Text = ans.GetAlphaNumberSeq(count);
}
How can I start the AlphaNumberSeq to zero and increment the count each time?
for example buffal. From 0-99 things work find, see the code:
int count = (int)Session["hostCount"];
if ((count >= 0) && (count <= 98))
{
count++;
SequenceNumbers sn = new SequenceNumbers();
lblSubStr.Text = sn.GetNumberSequence(count);
}
// first record would be buffal01, last record buffal99, next record should
be buffala1.
If that test fails the sequence of characters and numbers runs, a1, a2,
a3...z9. At this point there are 99 records in the database and the "count"
is 99. If I start the count at 99 then increment if by it will be 100 and the
sequence will start at l2, so I need to reset the count to start at 0 so that
the next record buffala1, see code:
else if ((count >= 0) && (count <= 233))
{// got to increment this somewhere
count = 0;
AlphaNumberSeq ans = new AlphaNumberSeq();
lblSubStr.Text = ans.GetAlphaNumberSeq(count);
}
How can I start the AlphaNumberSeq to zero and increment the count each time?