SqlConnection.ConnectionTimeout does not get passed to SqlCommand.CommandTimeout

by Dominic Zukiewicz 23. March 2010 09:45
I was working on a project in which the traffic had picked up significantly on a database. So in order to allow some of the longer queries to execute, I increased the SqlConnection time by changing the connection string: Connection Timeout=120 Great! We're done - aren't we? Well, no, we aren't. The problem is that although the SqlConnection.ConnectionTimeout has now been changed, the SqlCommand.CommandTimeout does not get affected and remains on the default 30 seconds. You will need to manually copy this value across to the CommandTimeout: SqlConnection conn = new SqlConnection ("M... [More]

Tags: , , ,

Data Access | .NET 2.0

Powered by BlogEngine.NET 1.5.0.7
Theme by Interakting

Interakting

A full service digital agency offering online strategy, design and usability, systems integration and online marketing services that deliver real business benefits and ensure your online objectives are met.

Calendar

<<  March 2010  >>
MoTuWeThFrSaSu
22232425262728
1234567
891011121314
15161718192021
22232425262728
2930311234

View posts in large calendar