Is it possible to change the default CommandTimeout value of the SqlCommand object via the config file? Our connection string has a timeout value in it which is not honored by the SqlCommand. I don't want to have to manually change every use of the SqlCommand object in order to increase my default timeout from 30 to 60.
Although not a CSLA.NET question, the answer is "No, you can't". The timeout in the connection string refers to the lenght of time to make the connection itself, not the length of time to execute queries or commands.
On the other hand, there is a timeout property on the SqlCommand class.
var cmd = new SqlCommand();
cmd.CommandTimeout = 120; // this means 120 seconds
The default command timeout is 30 seconds.
Yes, I understand this. I just didn't want to have to do this on ALL of my calls in order to increase it. I guess I may not have a choice.
Copyright (c) Marimer LLC