Click here to Skip to main content
11,931,584 members (67,126 online)
Rate this:
Please Sign up or sign in to vote.
See more: C#
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
Rate this: bad
Please Sign up or sign in to vote.

Solution 1


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
karteekboddu 12-Feb-13 8:18am
Thankyou for your solution,

Could you please provide some example code
Rate this: bad
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.


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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.151126.1 | Last Updated 12 Feb 2013
Copyright © CodeProject, 1999-2015
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