Problem with currencymanager and TrueDBGrid

  • Thread starter Thread starter mathieu.lapointe
  • Start date Start date
M

mathieu.lapointe

Hi,

I have a problem with a currencymanager bind with a datatable which is
the datasource of a Component One True DBGrid. An event update the
datatable every 30 seconds and the problem occurs when we have one
record and we pass to none, or we don't have any record and we add one
record. When the datatable is modified by the events, all the
procedures are done, but after, the application is frozen, but the code
behind continue to run normally. The event still be raised every 30
seconds and behind all work fine, but the application is frozen, and I
don't know why. I try to find where it can be frozen with breakpoints
in my code, but the breakpoints are not reached.

Is someone can help me?

Regards

Mathieu Lapointe
 
If you're updating UI controls (directly or indirectly, e.g. via data source
update) from another thread, your application will freeze from time to time.

You have to use Control.Invoke to update your controls from another thread
(e.g. System.Threading.Timer).



This problem is well known to Compact Framework developers as CF application
would freeze in ~99% of all cases.

Desktop developers are mostly unaware they have to use Control.Invoke as it
freezes in may be 1% of all cases.



Even though it works most of the time, the problem remains and you have to
do some extra work to ensure reliability of your application.


Best regards,



Ilya

This posting is provided "AS IS" with no warranties, and confers no rights.

*** Want to find answers instantly? Here's how... ***

1. Go to
http://groups-beta.google.com/group/microsoft.public.dotnet.framework.compactframework?hl=en
2. Type your question in the text box near "Search this group" button.
3. Hit "Search this group" button.
4. Read answer(s).
 
Hi

I update my datasource when I Receive a new Message through a
MessageQueue on the ReceiveCompleted event of the MessageQueue.

Cheers

Mathieu Lapointe
 
Yes, that's on a separate thread. Rule of thumb: assume events from all
asynchronous methods (e.g. BeginReceive()) are on the separate thread.

Please use Control.Invoke. In case you're not sure, there's
Control.InvokeRequired to check if you have to use Control.Invoke.


Best regards,

Ilya

This posting is provided "AS IS" with no warranties, and confers no rights.

*** Want to find answers instantly? Here's how... ***

1. Go to
http://groups-beta.google.com/group/microsoft.public.dotnet.framework.compactframework?hl=en
2. Type your question in the text box near "Search this group" button.
3. Hit "Search this group" button.
4. Read answer(s).
 
Back
Top