DevForce Help Reference
StoredProcQuery Class
Members  Example 


Not supported in DevForce 2010 RC1.
Object Model
StoredProcQuery ClassEntityManager ClassQueryStrategy Class
Syntax
'Declaration
 
Public Class StoredProcQuery 
   Implements IEntityQuery, IUntypedEntityQuery, System.ICloneable 
'Usage
 
Dim instance As StoredProcQuery
public class StoredProcQuery : IEntityQuery, IUntypedEntityQuery, System.ICloneable  
Remarks
The DevForce Object Mapper auto-generates two functions on the sub-typed EntityManager in your Domain Model for every stored procedure you've imported: the first returns a StoredProcQuery for the named procedure, and the second builds and executes a StoredProcQuery from the parameters provided and returns the results. To execute the StoredProcQuery returned by the first function mentioned, use EntityManager.ExecuteQuery or one of the available overloads.

These queries always use a FetchStrategy of DataSourceOnly, and cannot be used when disconnected from the EntityServer.

You must have already defined a FunctionImport in your Entity Domain Model in order to use the StoredProcQuery; you may not execute a stored procedure defined in your database but unknown to your model.

Note: Stored procedures returning primitive data types are not currently supported, therefore the ElementType must always be an Entity.

Example
// Sample 1 - Directly calling the generated method on your sub-typed EntityManager.
private void Sample1() {
   IdeaBladeTutorialManager mgr = new IdeaBladeTutorialManager();

   DateTime dt1 = DateTime.Parse("1/1/1990");
   DateTime dt2 = DateTime.Parse("1/1/2000");
   var results = mgr.GetSalesByYear(dt1, dt2);
}

// Sample 2 - Getting the StoredProcQuery from the generated method.
private void Sample2() {      
   IdeaBladeTutorialManager mgr = new IdeaBladeTutorialManager();
  
   DateTime dt1 = DateTime.Parse("1/1/1990");
   DateTime dt2 = DateTime.Parse("1/1/2000");
   StoredProcQuery query = mgr.GetSalesByYearQuery(dt1, dt2);
   var results = mgr.ExecuteQuery<SalesByYear>(query);
}
Inheritance Hierarchy

System.Object
   IdeaBlade.EntityModel.StoredProcQuery

Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

StoredProcQuery Members
IdeaBlade.EntityModel Namespace
EntityManager Property
IEntity Interface

Send Feedback