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.
using ( EntitiesModel dbContext = new EntitiesModel() )
object custOrdersOrders = dbContext.CustOrdersOrders( "ALFKI" ) as object;
Using dbContext As New EntitiesModel()
Dim custOrdersOrders() As Object = TryCast(dbContext.CustOrdersOrders("ALFKI"), Object())
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.