Cancel Statement

V

Verena Doll

Hi NG,

i want to cancel a sqlConnection.Open-Statement which takes sometimes a lot
of time. how can i practice that this statement i canceled afer 5 seconds,
if the connection is not open?

Thanks.
 
S

Simon Hart

I don;t think you can do this. Have you tried using a worker thread to do
the opening?

Regards
Simon.
 
V

Verena Doll

I have tried using a worker thread. i works fine, but when i close the
application the task is sometimes not terminated.
The reason is, that the first threads was started, but didn´t opened the
connection in five seconds. also the second thread starts and is able to
open the connection.
the first thread hangs and so the application didn´t terminate.

can you help me, please?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top