ok to use threading in winforms for remote connections?

  • Thread starter Thread starter Max
  • Start date Start date
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
 
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.
 
Back
Top