Kristijan Marin <(E-Mail Removed)> wrote:
> The flag would not exactly do the job, cause as i described .... I could see
> that entering method was done twice , didn't set trace on exit but Commit on
> DB was executed only ones ..I would expect Commit to be executed twice too..
> and that is the second time I presume ... no Rollback was executed ... cause
> if it would then i would know and no RETURN was neither executed .....
>
> Looks just like the code has lost it self somewhere in the middle .... and
> as I said in 1 or 2 examples form 2500.... so it's really hard to track ....
>
> but if I can recall i thing that all this stuff started to happen when I
> included DoEvents() ..... so now I'll remove all that from code and hope for
> the best ...
That's not a reassuring way of coding.
You shouldn't be doing DB work in the UI thread, basically.
Application.DoEvents() is typically used to make the UI responsive
during a long-running activity - but threads are a *much* better way of
doing that.
Unfortunately, threading is not an easy topic.
See
http://pobox.com/~skeet/csharp/threads
for an introduction.
--
Jon Skeet - <(E-Mail Removed)>
http://www.pobox.com/~skeet Blog:
http://www.msmvps.com/jon.skeet
World class .NET training in the UK:
http://iterativetraining.co.uk