I am asking a question from MS SSL using Python using source code:
< Code> import clr system.Data import from clr.AddReference ('System.Data') * connection = SqlClient.SqlConnection ("server = yourserver; database = news; uid = SA; password = password; timeout = 0") connection. Open () MyAction I>I just added
timeout = 0
, but I still found:Environment error: System.Data.SqlClient .SqlException (0x80131904): Timeout expired. The timeout period has expired before the operation is completed or the server is not responding. I tried to do it with
timeout = 1000000
, but still get the same error.If I run the same machine using the MSQLL client in the same machine, then it is completely fine. Do you know how to avoid this timeout exception?
Try increasing the CommandTimeout property on SqlCommand as described here:
Connection Timeout value in the string only controls the timeout for the initial connection of the database. If your SQL query takes a long time to execute, then this will not help; instead you need to use command timeout instead.
Comments
Post a Comment