Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
GetEntity and CommandType
Message
De
11/10/2007 13:56:56
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Titre:
GetEntity and CommandType
Divers
Thread ID:
01260368
Message ID:
01260368
Vues:
61
How do you handle times when you want to make a call to GentEntity() using a command type of CommandType.Text, but you might also need to make a call using a stored proc, in which case command type will be CommandType.StoredProcedure

For instance:


return this.GetEntity("OrdersSelectByPK", this.CreateParameter("@OrderID", orderID));

vs.

return this.GetEntity("SELECT * FROM Orders WHERE OrderID = @OrderID", this.CreateParameter("@OrderID", ...));


I know you can set DefaultCommandType to one or the other, but I could see needing to use both in my programming; So how do you swap back and forth? In other words, how could I pass a command string and override the default command type if I knew my command was not the default type?
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform