MiscellaneousUser
MiscellaneousUser

Reputation: 3043

Counter value to be accessible by every web call

I need to have a counter variable that needs to be increased every time a C# web service function is called. I can't use the session because I dont know just yet if all the requests will come from the same source everytime. The counter will be reset after x times, the details that it receives from the source is stored along with the details in the database. The idea of the counter is so that the record gets picked up by "countered" processor.

The only other way I can think is to have a windows service to allocate the requests but want to reduce the amount of applications and code that needs processing.

Alternatively a sql server trigger might do the trick but still have not worked out how to identify to persist a counter value between trigger calls.

Any advice on options 1 (Web Service) or option 3 (trigger) otherwise it'll have to be the option 2(windows service).

Upvotes: 0

Views: 78

Answers (1)

xPridex
xPridex

Reputation: 91

easy way is to use your application Settings file to store and retrieve the value.

Upvotes: 2

Related Questions