Thread: Threads Help
View Single Post
  #1 (permalink)  
Old July 31st, 2003, 10:23 AM
hybrid_dev hybrid_dev is offline
Registered User
Join Date: Jul 2003
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Threads Help

I have a form with a Search button, that switches into a Cancel button (just text changes and an IF/ELSE clause in the click effect)
So when I click Search, it changes into Cancel, i start a new thread that performs the loading of information from an SQL database into a DataSet, then i do some Invokes to set the datasource and the thread would end with my search results found.
The user could interrupt though by clicking the Cancel before the search is done and the thread is aborted, joined, and set to null.

The problem is, it works when i operate it normally, search and then cancel momentarily after, search and don't cancel it... but when i click it really fast, repeatedly, it messes up. The search continues and never stops, debug goes to the point of the SQL call (done thru a custom webservice) and the thread just seems to stop right there

any help would be appreciated. any thoughts? or further explanation?