Used to execute an Entity SQL statement within the DevForce framework.
Object Model
Syntax
Example
C# | Copy Code |
---|
// Sample 1 - A sample PassthruEsqlQuery returning a SalesPerson entity.
private void Sample1() {
AW2000Model.Manager mgr = new AW2000Model.Manager();
// Create a parameter and the parameterized sql
QueryParameter param = new QueryParameter("bonus", 2000);
ParameterizedEsql paramEsql = new ParameterizedEsql("SELECT VALUE sp FROM SalesPersons AS sp Where sp.Bonus > @bonus", param);
// Create and execute the query
var query = new PassthruEsqlQuery(typeof(SalesPerson), paramEsql);
var results = mgr.ExecuteQuery(query);
}
// Sample 2 - a sample PassthruEsqlQuery returning a scalar value.
private void Sample2() {
AW2000Model.Manager mgr = new AW2000Model.Manager();
// Create the query - note you must provide both the returnType and queryableType arguments here.
var query = new PassthruEsqlQuery(typeof(Int32), typeof(Customer),
"SELECT VALUE Count(c.CustomerType) FROM Customers AS c Where c.CustomerID < 10");
int result = mgr.ExecuteQuery(query).Cast<Int32>().First();
} |
Remarks
Inheritance Hierarchy
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