ok to use threading in winforms for remote connections?


M

Max

Is it proper to use threading in winforms to retrieve data from a remote sql
server? I thought about setting the timeout period in the connection string,
but what would be better is to start my bind() function in a new thread so
the app isn't tied up searching for the sql server.

Any problems I should be aware of?

-Max
 
Ad

Advertisements

G

Guest

There nothing wrong with using a different thread. You just have to make sure
you are doing everything threadsafe. You have to use the Invoke method if you
are doing anything in the UI. See this article:
http://weblogs.asp.net/justin_rogers/articles/126345.aspx

I've heard that next version of .net will have methods for doing
asynchronous command execution. :) Not out yet though.
 

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