Timeout Expired" message when executing program with SQL database call
-
Hi, I have a C# program that I am using to access a SQL database. The problem is one of the queries takes a reasonable long time (about 5mins in SQL query analyzer), but when I run my program it keeps throwing an exception of "Timeout Expired" I thought that by increasing the "Connect Timeout=600" to 600 would cure it but it doesn't. Help!
-
Hi, I have a C# program that I am using to access a SQL database. The problem is one of the queries takes a reasonable long time (about 5mins in SQL query analyzer), but when I run my program it keeps throwing an exception of "Timeout Expired" I thought that by increasing the "Connect Timeout=600" to 600 would cure it but it doesn't. Help!
Are you using the SqlCommand object? A SqlCommand object has a CommandTimeout property which is independant of the "Connect Timeout" property in the connection string which I believe defaults to 30 seconds. If you are using a SqlCommand, change this property as wel as that in the connection string. Rhys The use of COBOL cripples the mind; its teaching should, therefore, be regarded as a criminal offense Edsgar Dijkstra If life were fair, Dan Quayle would be making a living asking 'Do you want fries with that?' John Cleese