IDbCommand.CommandTimeout Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets or sets the wait time (in seconds) before terminating the attempt to execute a command and generating an error.
public:
property int CommandTimeout { int get(); void set(int value); };
public int CommandTimeout { get; set; }
member this.CommandTimeout : int with get, set
Public Property CommandTimeout As Integer
Property Value
The time (in seconds) to wait for the command to execute. The default value is 30 seconds.
Exceptions
The property value assigned is less than 0.
Examples
The following example creates an instance of a derived class, SqlCommand and sets some of its properties.
public void CreateSqlCommand()
{
SqlCommand command = new SqlCommand();
command.CommandTimeout = 15;
command.CommandType = CommandType.Text;
}
Public Sub CreateSqlCommand()
Dim command As New SqlCommand()
command.CommandTimeout = 15
command.CommandType = CommandType.Text
End Sub
Applies to
See also
Feedback
https://aka.ms/ContentUserFeedback.
Kommer snart: I hele 2024 udfaser vi GitHub-problemer som feedbackmekanisme for indhold og erstatter det med et nyt feedbacksystem. Du kan få flere oplysninger under:Indsend og få vist feedback om