Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 654105
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T22:27:26+00:00 2026-05-13T22:27:26+00:00

I see a question about this here . However, in my case, It is

  • 0

I see a question about this here.
However, in my case, It is the windows service which in running the long running insert/update on a table and I need to cancel the operation from my ASP.NET application.
In the above link Burnsys suggests that one should kill the Sql server session. Is that really only way and a goood practice to do this?

Also, in the same poset somebody suggests one can use SqlCommand.Cancel to cancel. However, I am not sure how can I cancel the command from the windows service from ASP.NET application.

Please advice.

Thanks in advance for all your valuable comments,
Ashish

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T22:27:26+00:00Added an answer on May 13, 2026 at 10:27 pm

    1) If you can change the code of windows service or stored proc, I suggest creating some table on sql server to store states of long running task. Windows service (than could be executed by service) would add records to this table. ASP.NET application would monitor this table (manualy) to stop any runnning process.

    If you still using sql server 2005, you still can use KillProcess(ProcessId). So store processId to this table and asp.net application can send kill process command to sql server (if you have permissions).

    2) If you have any programming (wcf for example) interface of service that hosted in windows service, so I suggest exetuting LR task asynchronously and add method to cancel this task. ASP.NET application could call this cancel method.

    SqlCommand command = new SqlCommand();
                command.BeginExecuteNonQuery();
    
    ...
                command.Cancel();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I just posted this question and learned about <see cref=> , however when i
I've seen some similar questions about this around here but I didn't see anything
Sorry about the stupid question however I can't see/ not good enough to solve
This is a question about web application architecture rather than coding per se, however
This is more of a general question about which direction would be a better
I see many question/answers about how to convert a Hashtable to a Dictionary, but
I see a lot of questions, both here on SO and elsewhere, about maintaining
(See question below for more context): Are there any situations in which <machineKey validationKey=AutoGenerate,IsolateApps
Just playing around with interfaces and I have a question about something which I
This question is more or less programming language agnostic. However as I'm mostly into

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.