Telerik OpenAccess ORM

Telerik OpenAccess ORM Send comments on this topic.
How to: Execute a Query Using a Stored Procedure
See Also
Programmer's Guide > Feature Reference > API > LINQ Guide > How to: Execute a Query Using a Stored Procedure

Glossary Item Box

Many application developers and database administrators use stored procedures to enforce security, provide predictability, and encapsulate logic on data inside the database. Application code that retrieves data which is mapped to a stored procedure uses a function identified by the FunctionAttribute.

To run the code in this example, you need to create a new Telerik OpenAccess Domain Model based on the Northwind database. You will need to include all stored procedures from the Northwind database.

The following code runs the stored procedure to return results.

C# Copy Code
using ( EntitiesModel dbContext = new EntitiesModel() )
{
   
object[] custOrdersOrders = dbContext.CustOrdersOrders( "ALFKI" ) as object[];
}  
VB.NET Copy Code
Using dbContext As New EntitiesModel()
 Dim custOrdersOrders() As Object = TryCast(dbContext.CustOrdersOrders("ALFKI"), Object())
End Using

Working with OpenAccess ADO API

Besides querying an OpenAccess Domain Model by using standard LINQ expressions, there is one more way you can query the domain model, and that is through the OpenAccess ADO API. Using LINQ queries is simple and easy. However, if you are concerned about the performance and comfortable writing ADO.NET like code, then the OpenAccess ADO API is perfect for you. The OpenAccess ADO API allows you to execute stored procedures and materialize entities from the result set.

For more information, please refer to Low Level (ADO) API.

See Also