|
Use the use private (may be static) DateTime variable to store timestamp of previous message.
use the Timer or Lock statement to check if it changes in 30 secs.
|
|
|
|
|
Create a class which represents the message called MyMessage. Store the previous message as a static variable of type MyMessage called previousMessage. If the current myCurrentMessage.RecievedDateTime < previousMessage.RecievedDateTime.AddSeconds(30), then assumeIsSameAsPrevious. Do stuff and then previousMessage = myCurrentMessage.
"You get that on the big jobs."
|
|
|
|
|
Is this a web service or a windows service?
|
|
|
|
|
Not sure yet, but by looking at the previous replies, I have my answer to how to solve this now.
Thank you.
|
|
|
|
|
arkiboys wrote: Not sure yet
How can you not be sure of whether it's a web service or a windows service? You stated that "my service" is doing this and that. If it's "your" service, you should be completely familiar with what it is.
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass." - Dale Earnhardt, 1997
|
|
|
|
|
Apologies, I meant that I am not sure whether to have the finished result in win or web service.
Thanks
|
|
|
|
|
You can't actually store anything inside a web service. It's a transient thing. I'm absolutely astonished that you have started coding before you've even considered the overall architecture. Has nothing that we have said sunk in at all?
Before you write any more code, sort out your architecture. You are digging yourself into a bigger and bigger hole, and hoping that we have enough rope to pull you out.
|
|
|
|
|
Yep. Understanding the ramifications of each plaform, langauge, and architecture choice is crucial to designing an app.
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass." - Dale Earnhardt, 1997
|
|
|
|
|
Hello,
Thank you for your concern...
At present I am actually testing the flexibility as I am learning and reading alot...
I do believe i now know the capabilities of windows service and I think you are right, I will intent to use the windows service when I am comfortable with it as I am testing to see how i get on with it.
many thanks
|
|
|
|
|
Wow! Both very different things. Unless you are sure about your service, it is very difficult to decide on the correct solution.
|
|
|
|
|
The solution is to create a HashTable with the DateTime as the key (stripped of the seconds/milliseconds), and the message as the value . Each time you try to add it, the nature of the HashTable will prevent duplicate keys from being added. Problem solved.
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass." - Dale Earnhardt, 1997
|
|
|
|
|
Hi,
I made a tool to read a .mdb File, everything works fine except on a 64Bit Machine...
To connect to the database I use OLEDB 4.0, but it seems that 64x does not provide this.
How could I compile this compatible??
OleDbConnection con = new OleDbConnection(
@"Provider=Microsoft.Jet.OLEDB.4.0;
Data Source=" + lblDATABASE.Text);
con.Open();
|
|
|
|
|
You need to add the App.config file I believe.
V.
|
|
|
|
|
sry I don't know what you mean. 
|
|
|
|
|
I had a similar problem and strangly, by adding an App.Config file to my project (even if it is just empty) the connection then works.
Right click your project, choose add item --> new and find the template 'config', normally it should automatically name it App.config. Press OK. recompile and try again.
V.
|
|
|
|
|
Compile it to x86.
I cannot remember: What did I before google?
|
|
|
|
|
Yeah I already tried this, but doesn't work..
I tried "any cpu" / "x86" / "x64" to build.
|
|
|
|
|
You have to set it in the "project properties", in the "build" tab, "platform target". I had the same problem with an old application using access, and it worked fine for me.
I cannot remember: What did I before google?
|
|
|
|
|
Yeah I know!
I already tried this, without success! 
|
|
|
|
|
Thanks for your replies, it seems that the .exe need the manifest.
Now it works =)
/closed
|
|
|
|
|
ok, if this worsk for you it also fine.
I cannot remember: What did I before google?
|
|
|
|
|
OK, I don't know what you did that required a manifest, but this problem, as you decribed it, only needed to be compiled to target x86 CPUs. The reason why it doesn't work is because there are no 64-bit providers for Access databases. Since you can't mix 32-bit and 64-bit code in the same process, using an Access database will fail.
|
|
|
|
|
Hi
I want to learn MVC2 and have zero knowledge about it. please suggest some help (ebook, site or some thing else)
Regards
|
|
|
|
|
|
Have you tried msdn?
The funniest thing about this particular signature is that by the time you realise it doesn't say anything it's too late to stop reading it.
My latest tip/trick
|
|
|
|