Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How do you set the Command Timeout
Message
 
À
22/11/2004 20:17:28
Max Fillmore
Essential Skills, Inc.
Lenexa, Kansas, États-Unis
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Versions des environnements
Environment:
VB.NET 1.1
Database:
MS SQL Server
Divers
Thread ID:
00963696
Message ID:
00963899
Vues:
10
Max,

This is something I just addressed today. One of our MM .NET MVPs (Jason Mesches) requested the ability to easily change the CommandTimeout property of the Select command object.

In response we have added a new CommandTimeout class-level variable to the abstract mmDataAccessBase class which is set to 30 by default. In the concrete data access subclasses, we have added code to the FillDataSet method that copies this value from the data access class to the Select Command object. For example:
public override void FillDataSet(DataSet ds, IDbDataAdapter dbAdapter, 
	string tableName, bool clearOnFill)
{
	// If the Select command's connection is null, use the existing connection
	// associated with the data access class, or create a new one
	if (dbAdapter.SelectCommand.Connection == null)
	{
		if (this.Connection == null)
		{
			this.Connection = this.CreateSqlConnection();
		}
		dbAdapter.SelectCommand.Conection = this.Connection;
		dbAdapter.SelectCommand.CommandTimeout = this.CommandTimeout;
	}
This change will be included in the upcoming release of MM .NET, but if you want to implement a temporary solution, you can create a custom data access class of mmDataAccessSql, add the CommandTimeout class-level variable, and override the FillDataSet() method, adding the code I've shown above. For details on using a custom data access class, see the MM .NET Dev Guide topic "Creating Custom Data Access Classes".

Regards,
Kevin McNeish
Eight-Time .NET MVP
VFP and iOS Author, Speaker & Trainer
Oak Leaf Enterprises, Inc.
Chief Architect, MM Framework
http://www.oakleafsd.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform