Thứ Bảy, 20 tháng 4, 2019

[ASP.NET] SQL : The wait operation timed out

Do query thực thi quá lâu, mặc định timeout là 30s. Trường hợp này có thể set tăng timeout trong code thực thi query.

In your code where you run the stored procedure you should have something like this:

SqlCommand c = new SqlCommand(...)
//...
Add such a line of code:

c.CommandTimeout = 0;
This will wait as much time as needed for the operation to complete.

đây là 1 ví dụ về set timoute exute query
Trên vd đang set 0 là không limit , Bạn có thể set 60 hoặc 120 chẳng hạn

Không có nhận xét nào: