views:

23

answers:

2

Hi all,

I have a button clicking which a storedproc runs for long time in buttons onclick event. I have a grid which will show log table data which gets updated by the storedproc.

I want to refresh the grid to show the updated log while the storedproc runs.

Is it possible?

If yes plz help.

A: 

Execute your query using async queries. While this is running update your grid.

When using commands to execute the query you can use code like this:

SqlCommand cmd = new SqlCommand("Your query", connection)
cmd.BeginExecuteNonQuery()

This will run the query without waiting for the result.

rdkleine
Too generic answer that can not really answer the question.
Aristos
A: 

If you wanted a "live log" that kept updating, you could start up a background thread that polls the database and updates the user's session or the application cache (if it's something that's useful to have globally).

On the ASPX side, add a timer that updates the grid on each tick. If you wanted this to only run once, you could do everything the same, just don't have the background thread loop and have the timer disable once data is found.

o6tech