Why is my BeginInvoke method not async?
Posted
by Petr
on Stack Overflow
See other posts from Stack Overflow
or by Petr
Published on 2010-05-05T09:24:06Z
Indexed on
2010/05/05
9:28 UTC
Read the original article
Hit count: 259
Hi, In order to avoid freezing of GUI, I wanted to run method connecting to DB asynchronously. Therefore I have written this:
DelegatLoginu dl = ConnectDB;
IAsyncResult ar=dl.BeginInvoke(null, null);
bool result = (bool)dl.EndInvoke(ar);
But it is still freezing and I do not understand why - I though BeginInvoke assures that method it references is run in another thread. Thank you!
© Stack Overflow or respective owner