Set custom default CommandTimeout for all new Command Objects
问题 The default CommandTimeout value is 30 seconds. You can manually change the value on an instance of the command object by doing the following Dim cmd As New System.Data.SqlClient.SqlCommand cmd.CommandTimeout = 60 Is there a way to specify a different default value, such that all new command objects will automatically have this value within your solution when they are created? 回答1: As far as I know no, there is no way to change this default. The constructor code for a SqlCommand is this: