Click here to Skip to main content
15,905,781 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi There,

I am facing issue as "Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding". So i need to specify commandtimeout in to connection string as we are using third party dll for sqlhelper where we can not set command timeout through the code.
One more thing is this issue will get resolved after increasing the connection timeout in connection string?
Posted
Comments
Tomas Takac 7-Jan-16 8:11am    
You only can specify the connection timeout in the connection string. You can set the command timeout in the command object.
Sinisa Hajnal 7-Jan-16 9:19am    
What have you tried?

1 solution

As Tomas Takac said, the timeout in the Connection String is for the connection process only.

The correct way woudl be to use the CommandTimeOut[^] property in your code.

If you are using the Microsoft Data Access Application Block SqlHelper class then sqlhelper has been succeeded by DataBase and you can set the command timeout with DBCommand.SetCommandTimeout.

If you are using an older version (i.e. MS DAAB SqlHelper) then there are overrides on the FillDataSet method that take a command timeout parameter.

If you are using something else, then search using intellisense for something similar to "commandtimeout" in your 3rd party dll or contact the author/vendor.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900