Reputation: 59
Logging:System.Data.SqlClient.SqlException: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
i am a beginner when i saw in the application log files the above is the most frequent error i saw and also it is getting repeated everyday. on the database when i saw time taken for executing the particular procedure which the above function is calling is less than 5 secs.
But in the application we gave connection timeout=200s
and by default command timeout=30 secs
our manager says we don't have to increase the command timeout by anymore further as it is true. But still the exception is keep coming.
can anyone suggest me any solution so i can get rid of the above problem thanks
Upvotes: 2
Views: 2556
Reputation: 16259
The setting in the web config, if it's the timeout in the connection string setting, is the connection timeout. It only applies to the time it takes to make a connection. From your problem description, it doesn't sound like a connection timeout is what's happening.
Command timeouts are specified in other ways. If you are using DataContext, for example, the timeout is set using the CommandTimeout property.
http://msdn.microsoft.com/en-us/library/system.data.linq.datacontext.commandtimeout.aspx
If you can give a code snippet of how you are hitting the database so we can see what classes you are using, more specific recommendations can be made.
Upvotes: 2