Click here to Skip to main content
15,867,686 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
hi, I m facing timeout while updating data in SQL. The project was made in C#. Previously it was working well, suddenly from yesterday I am facing the problem. Please advise me what I should do. Thanx in advance
Posted
Comments
Prabhakaran Soundarapandian 8-Aug-12 2:14am    
Without knowing your code/cause...how could we help you?

If you are using an OdbcCommand or other Command derived from Command, there is a timeout property that you can increase.
Other than that you can check the SQL query you are executing and verify that all indexes are provided for.
As data is increasing in the tables of the database, it is possible that your query suddenly does not work anymore because now the query takes a little longer to execute. I think the timeout is by default 30s.
 
Share this answer
 
v2
The SqlCommand object has a CommandTimeout property the default is 30 seconds try increasing it:
http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlcommand.commandtimeout.aspx[^]
 
Share this answer
 
First of all increase the CommandTimeout property then if it continues to time out make sure your sqlServer.exe is open and running.
 
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