Click here to Skip to main content
15,887,746 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
I tried searching for this particular answer but with no successful results and this is my last hope.

I am having a timeout error when updating 516rows in a table, but when the table only has 56 rows in it, it updates each row successfully, but when there is 516 rows returned to be updated and i loop through the first row and try and update it, i get the following error

Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.

Note, when the table consist of only 56 it works fine.

I tried setting the commandTimeOut to 0 and 100 but nothing seems to work

Can anyone advice me on what to do?
Posted

Increase the connection timeout period !
 
Share this answer
 
Looks like you are opening the connection at the beginning and closing it after executing all 516 records. Don't do it. Open and close the connection in each iteration.
 
Share this answer
 
wrote:
Note, when the table consist of only 56 it works fine.


Try update command with some conditions


wrote:
I tried setting the commandTimeOut to 0 and 100 but nothing seems to work


100 is too less time.
Try using value : 40000
 
Share this answer
 
Looks like you are opening the connection at the beginning and closing it after executing all 516 records. Don't do it. Open and close the connection in each iteration.


I would of thought this would effect performance, but if nothing else works this would probably do the trick.

Thanks
 
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