I have a table named login
I am binded login table with rdlc report in a table whose showing username and password from login table into report
but now m wanna tht in my rdlc report table show initially 10 rows thn as data comes from login table it just inerted automatically
but as the number of rows are more thn 10 thn the other rows will be displayed on the next page in the same manner.
Why not just use the Stopwatch class instead? As you currently have this implementation, you aren't actually displaying the elapsed time - you're just displaying an arbitrary value (oh, and if you use Debug.WriteLine in the OnTimedEvent, you can track the elapsed in the output window without having to marshall across to the UI thread.
I was brought up to respect my elders. I don't respect many people nowadays.
Thanks for the tipp. I have a continuos signal and need to take measurements every 20ms. Can you give me a codeexample, how to use stopwatch in this case? Actually I think I need a thread that constantly tests if my stopwatch elapsed time is divisible by 20ms?
Measure it manually and checking everytime for elapsed time never good option. timer is for that purpose. you are calling method every 20ms it means your code is executed 50 times per second. Please elaborate your actual problem. Why you need to execute function after 20ms ?
The System.Timers.Timer is too slow in my application.
That's beautifully vague but I'll assume that you are wondering why the real timer interval is fairly consistent but is is not 20ms.
The timer does not have a millisecond resolution and although the programmer may set different values e.g. 17, 18, 19 or 20 ms the actual interval obtained may not vary. On most systems the resolution of the timer is 15.625 ms which means that the real timer intervals can only be multiples of 15.625ms, i.e. 15.625, 31.25, 46.875 etc. So when you set 20ms, what you actually get is rounded up to the next possible real interval, i.e. 31.25ms.
As Eddy said in his reply the operating system is not real time and the timer event may be delayed slightly beyond the rounded up interval.
Precision - I like that! I knew that the resolution was around 16ms on most systems but now I know its 15.625ms.
Timers have been rubbish for ages, but I think I recall being surprised that the one on my PC is actually considerably more accurate than that. But, as you say when dealing in the ms range I'd have thought that waiting for a context switch could certainly bump things into the next ms or so.
For most purposes, the advice that (always reliable) Pete O'Hanlon gave you, to use an instance of System.Diagnostics.Stopwatch: is what you need.
But, given your requirements, you may also want to examine this April 13, CodeProject article: "Microsecond and Millisecond C# Timer," by Ken Loveday: [^].
And, possibly other resources on high-precision .NET timing at: [^].
However, I do not know if any of the techniques above can meet your requirements: I have never needed higher-precision timing than that provided by 'Stopwatch.
When you use the 'Stopwatch class, I hope you don't make the same stupid mistake I made recently [^], and use Stopwatch.Elapsed.Milliseconds, thinking that gets the total time, instead of Stopwatch.TotalElapsedMilliseconds, as was kindly pointed out to me by Alan N. here on this forum: [^].
good luck, Bill
“This isn't right; this isn't even wrong." Wolfgang Pauli, commenting on a physics paper submitted for a journal
I have successfully used (via P/Invoke wrappers I wrote) both the MultimediaTimer [now depreciated but has been available on every system I have ever tested] and TimerQueueTimer with greater precision than you are requiring.
I can dig the code out if you would like it, but it didn't take me too long to knock it up from scratch as I remember.
They are not recommended for general purpose timers however and it is very rare that level of precision is required!
Please clear my doubt.
I have one server system where i installed sql server.
5 client machines accessing that.
now suppose if there is any power fluctuation like it's coming for 5 min and again going and so on.
So for this kind of situation, how to save the data or how to update the database each second.??
Is it possible that at a time we update the client database also and server database also.?
i.e at button click it should update both client and server database..
Sound like mirroring to me and yes that's a database function and not on the client. Mirroring is generally a rather complex setup between major servers I don't think it applies to mirroring to a client machine.
Never underestimate the power of human stupidity
It is possible, you need to look up database mirroring / database replication.
Please ask further question on this topic in one of the specialised SQL forums (it can get quite complicated depending on your needs), this forum is devoted to c#. Note that if you do it properly it will be transparent to the database users.
Same problem I faced earlier when user need to sync data with more than two databases. we keep insert, update delete operation with data in a queue and create window service that sync queued operations with other databases(may or may not be same).
It will sync deferential data not all.
Last Visit: 31-Dec-99 19:00 Last Update: 30-Jan-23 23:21