Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# GimmeCode NoEffort
Hello all,
 
How to stop a long running query on button click from front end and how to stop filling data to datatable when stop button clicked.
 
so my requirement is like if i clicked on stop button whatever data fetched into datatable that should populate in gridview.
 
i am using oracle as my database.
 
please suggest me a way how to do it with example.
 
thanks in advance,
Posted 12-Feb-13 3:01am
Edited 12-Feb-13 4:19am
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Hi,
 
1) Read your records one by one using the SQLDatareader and add it into the data table
2) If the user clicks stop button, break the loop and show the data which is in the data table.
 
Best Regards
Muthuraja
  Permalink  
Comments
karteekboddu at 12-Feb-13 8:18am
   
Thankyou for your solution,
 
Could you please provide some example code
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

I don't think its possible.
 
You could kill the thread from outside if you want but that is terribly risky and can cause problems.
 
Cheers,
Edo
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 275
1 OriginalGriff 230
2 BillWoodruff 173
3 CPallini 155
4 Kamal Rocks 144
0 OriginalGriff 5,655
1 DamithSL 4,506
2 Maciej Los 3,997
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,180


Advertise | Privacy | Mobile
Web02 | 2.8.141216.1 | Last Updated 12 Feb 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100