Resets the CommandTimeout property to the default value.
[Visual Basic]
Public Sub ResetCommandTimeout()
[C#]
public void ResetCommandTimeout();
[C++]
public: void ResetCommandTimeout();
[JScript]
public function ResetCommandTimeout();
The default value of the CommandTimeout is 30 seconds.
[Visual Basic, C#] The following example creates a DB2®Command, sets the CommandTimeout, displays the property, resets the CommandTimeout, and displays the property again. To accomplish this, the method is passed a string that is an SQL SELECT statement and a string to use to connect to the database.
[Visual Basic]
Public Sub CreateMyDB2Command(mySelectQuery As String, _
myConnectionString As String)
Dim myConnection As New DB2Connection(myConnectionString)
Dim myCommand As New DB2Command(mySelectQuery, myConnection)
myCommand.CommandTimeout = 15
MessageBox.Show(myCommand.CommandTimeout.ToString())
myCommand.ResetCommandTimeout()
MessageBox.Show(myCommand.CommandTimeout.ToString())
End Sub
[C#]
public void CreateMyDB2Command(string mySelectQuery, string myConnectionString)
{
DB2Connection myConnection = new DB2Connection(myConnectionString);
DB2Command myCommand = new DB2Command(mySelectQuery, myConnection);
myCommand.CommandTimeout = 15;
MessageBox.Show(myCommand.CommandTimeout.ToString());
myCommand.ResetCommandTimeout();
MessageBox.Show(myCommand.CommandTimeout.ToString());
}