IdeaBlade DevForce 2010 Help Reference
StoredProcQuery Class
Members  Example  See Also  Send Feedback
IdeaBlade.EntityModel Assembly > IdeaBlade.EntityModel Namespace : StoredProcQuery Class



Not supported in DevForce 2010 RC1.

Object Model

StoredProcQuery ClassEntityManager ClassQueryStrategy Class

Syntax

Visual Basic (Declaration) 
Public Class StoredProcQuery 
   Implements IEntityQueryIUntypedEntityQuerySystem.ICloneable 
Visual Basic (Usage)Copy Code
Dim instance As StoredProcQuery
C# 
public class StoredProcQuery : IEntityQueryIUntypedEntityQuerySystem.ICloneable  
C++/CLI 
public ref class StoredProcQuery : public IEntityQueryIUntypedEntityQuerySystem.ICloneable  

Example

C#Copy Code
// Sample 1 - Directly calling the generated method on your sub-typed EntityManager.
private void Sample1() {
   IdeaBladeTutorial.Manager mgr = new IdeaBladeTutorial.Manager();

   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() {      
   IdeaBladeTutorial.Manager mgr = new IdeaBladeTutorial.Manager();
  
   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);
}

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.

Inheritance Hierarchy

System.Object
   IdeaBlade.EntityModel.StoredProcQuery

Requirements

Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family

See Also

© 2013 All Rights Reserved.