Stream in asp.net/c#

I want to create a stream on event_login Event or Form_load Event. In this thread, I want to call a class function to execute some sql statement, and the user does not need to wait for the result or background process to complete, it just redirects to the desired page, let it say my profile or something else. I am using ASP.NET, C #.

+1
source share
3 answers

What it's worth is a bad idea. There are many ways that IIS can complete this background thread (restart IIS, restart the application pool, etc., all of which are the normal expected behavior of IIS), and the result is that the database transaction is canceled.

, , Windows . , - IIS AJAX.

+3
+1

, Thread.Start. IsBackground , .

http://msdn.microsoft.com/en-us/library/7a2f3ay4.aspx

But, since most of your time is likely to be spent on your database call. Why just execute it asynchronously without a callback? On SqlCommand, which will be BeginExecuteNonQuery.

0
source

Source: https://habr.com/ru/post/1771149/


All Articles