I have a Winforms application created in Visual Studio 2005 Pro, it connects to an SQL Server 2005 database using the SqlConnection / SqlCommand / SqlDataAdapter classes to extract data. I have stored procedures in my database to return the data to me.
What is the best way to handle queries that take a "long time" to complete? (i.e long enough that the user starts to think something is wrong). Currently my application locks up until the query is complete, or the query times out. Obviously this is unnacceptable.
I'd at least like a progress meter with a "stop" button on it. The progress meter doesn't even have to do anything useful, being a hint to sit patiently and wait would be enough.
Even better would be a warning that said something like "This will return 140,000 rows of data. Do you want to continue?"
I know this probably requires threads, but how?