asp.net.ph

SqlCommand.ResetCommandTimeout Method

System.Data.SqlClient Namespace   SqlCommand Class


Resets the CommandTimeout property to its default value.

[ VB ]
Public Sub ResetCommandTimeout ( )

[ C# ]
public void ResetCommandTimeout ( );

[ C++ ]
public: void ResetCommandTimeout ( );

[ JScript ]
public function ResetCommandTimeout ( );

Remarks

The default value of the CommandTimeout is 30 seconds.

Example

The following example initializes an SqlCommand, sets the CommandTimeout, displays the property,resets the CommandTimeout, and displays the property again. In the example, the application passes a string that is an SQL Select statement and a string to use to connect to the data source.

void setSqlCommand ( string query, SqlConnection myConn ) {
   SqlCommand myCommand = new SqlCommand ( query, myConn );
   myCommand.CommandTimeout = 15;
   Response.Write ( myCommand.CommandTimeout.ToString ( ) );
   myCommand.ResetCommandTimeout ( );
   Response.Write ( myCommand.CommandTimeout.ToString ( ) );
}
  C# VB

See Also

SqlCommand Members Skip Navigation Links




Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support asp.net.ph