Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Sequential numbers without a database?

Reply
Thread Tools

Sequential numbers without a database?

 
 
Mike Kingscott
Guest
Posts: n/a
 
      07-01-2004
Hi all,

I'd building an app that posts to a web service. One of the things
that is required in the soap header is a sequential number appended to
a ref, i.e. "IGI1001", "IGI1002", etc.

Obviously the first part of the reference ("IGI") stays the same, but
I need an incrementing number generated. Now, I was thinking of doing
this via a SQL database, but it would be an awful waste as there would
only be one table and one stored procedure in it. Then I was thinking
of putting it in an application variable: it would be read from a file
at the application start, incremented through the life of the
application, then written back to the file at application end. I
quickly discounted that in case the new number didn't get written back
to the file for whatever reason.

Incidentally, the web service expects the caller to provide the
incrementing alpha-numeric reference, so it won't be done at the web
service.

Any thoughts?

Kind regards,

Mike Kingscott
 
Reply With Quote
 
 
 
 
Benjamin Bittner
Guest
Posts: n/a
 
      07-01-2004
Hallo Mike
"Mike Kingscott" <(E-Mail Removed)9.co.uk> schrieb im Newsbeitrag
news:(E-Mail Removed) om...
> Hi all,
>
> I'd building an app that posts to a web service. One of the things
> that is required in the soap header is a sequential number appended to
> a ref, i.e. "IGI1001", "IGI1002", etc.
>
> Obviously the first part of the reference ("IGI") stays the same, but
> I need an incrementing number generated. Now, I was thinking of doing
> this via a SQL database, but it would be an awful waste as there would
> only be one table and one stored procedure in it. Then I was thinking
> of putting it in an application variable: it would be read from a file
> at the application start, incremented through the life of the
> application, then written back to the file at application end. I
> quickly discounted that in case the new number didn't get written back
> to the file for whatever reason.
>
> Incidentally, the web service expects the caller to provide the
> incrementing alpha-numeric reference, so it won't be done at the web
> service.
>
> Any thoughts?
>
> Kind regards,
>
> Mike Kingscott


I think, wether it is a waste, to use a sql database. its the safest way to
ensure there is always an incremented number.

regards benni


 
Reply With Quote
 
 
 
 
Scott Allen
Guest
Posts: n/a
 
      07-02-2004
Any chance you could use a timestamp, or a GUID in the headers to make
them unique? Or does it absolutely have to be a sequential number?

Perhaps you could use a combination of incremented number and a
TimeStamp. The TimeStamp could be the time at which the application
started, say with DateTime.Now.Ticks. The sequential ID could then be
a static field that you increment with the Interlocked.Increment
method.

Possible?

--
Scott
http://www.OdeToCode.com


On 1 Jul 2004 03:25:58 -0700, http://www.velocityreviews.com/forums/(E-Mail Removed)9.co.uk (Mike Kingscott)
wrote:

>Hi all,
>
>I'd building an app that posts to a web service. One of the things
>that is required in the soap header is a sequential number appended to
>a ref, i.e. "IGI1001", "IGI1002", etc.
>
>Obviously the first part of the reference ("IGI") stays the same, but
>I need an incrementing number generated. Now, I was thinking of doing
>this via a SQL database, but it would be an awful waste as there would
>only be one table and one stored procedure in it. Then I was thinking
>of putting it in an application variable: it would be read from a file
>at the application start, incremented through the life of the
>application, then written back to the file at application end. I
>quickly discounted that in case the new number didn't get written back
>to the file for whatever reason.
>
>Incidentally, the web service expects the caller to provide the
>incrementing alpha-numeric reference, so it won't be done at the web
>service.
>
>Any thoughts?
>
>Kind regards,
>
>Mike Kingscott


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sequential Circuits power up Reset john VHDL 7 07-01-2005 06:09 PM
Signals and variables, concurrent and sequential assignments Taras_96 VHDL 5 04-14-2005 03:07 AM
Sequential Machines john VHDL 6 11-05-2004 05:24 AM
Sequential numbers - a real challenge Ken Javascript 1 02-13-2004 05:13 AM
[EXCEL] sequential =?iso-8859-1?q?acc=E8s=2E?= =?iso-8859-1?b?Sulq6Q==?= Perl 0 01-23-2004 02:49 PM



Advertisments