Windows Develop Bookmark and Share   
 index > Windows Forms Data Controls and Databinding > How do I cancel a web thread?
 

How do I cancel a web thread?

Hi,

I have a client application that gets large chunks of data from web services, I need to provide a way for the user to cancel the download in the event it takes to long, they selected the wrong thing etc.

Currently to connect to the WS I spin a thread and then make the call on that thread, when the user clicks cancel, I can abort that thread, which causes a Thread aborted exception when the WS finally responds or finishs. I can supress that exception and life goes on, but it sure feels like a hacky way to deal with this problem... anyone know a good pattern for this?

Bruce M  Monday, June 26, 2006 6:08 PM
I would use begin and end invoke instead of calling the webservice on a thread. Check out this article.
Ken Tucker  Monday, June 26, 2006 6:45 PM

You can use google to search for other answers

Custom Search

More Threads

• DataGridView with BindingSource
• DataBinding for DataGridView isn't working as I like it to...
• How do I disable BindingSource (ControlUpdate) based on a criteria
• Datagrid C# question.
• DataGridView CellValueChanged Event
• Storing value from my ComboBox hosted in cell in DataGridView
• DataGrid.Navigate Event
• Looking For ValueMember From ComboBox
• multiselection in a datagrid
• BindingSource.BindingComplete Event does not get raised