Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
GetEntity and CommandType
Message
From
11/10/2007 13:56:56
 
 
To
All
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Title:
GetEntity and CommandType
Miscellaneous
Thread ID:
01260368
Message ID:
01260368
Views:
60
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?
Next
Reply
Map
View

Click here to load this message in the networking platform