Click here to Skip to main content
15,119,410 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
Without knowing your code/ 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.
The SqlCommand object has a CommandTimeout property the default is 30 seconds try increasing it:[^]
First of all increase the CommandTimeout property then if it continues to time out make sure your sqlServer.exe is open and running.

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