This is a migrated thread and some comments may be shown as answers.

How To ExecuteThe StoreProcedure

1 Answer 111 Views
OQL (OQL specific questions)
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Majid
Top achievements
Rank 2
Majid asked on 06 Dec 2008, 07:14 AM
How can i execute the store procedure wirtten in SQL Express 2005. Actualy what class should i use to run the store procedure?

Thanks.

1 Answer, 1 is accepted

Sort by
0
Accepted
Thomas
Telerik team
answered on 08 Dec 2008, 03:23 PM
Hi Majid,

as OpenAccess does not generate a SP-specific proxy you will need to use IObjectScope.GetSqlQuery(string,Type,string) to call a stored procedure.

Example:

IQuery q = scope.GetSqlQuery("foobar ?, ?",null,"INTEGER i, FLOAT f");
IQueryResult r = q.Execute(new object[] { 42, 0.1234f });
r.GetEnumerator(); // triggers the execution!

This would execute the foobar SP with the integer parameter 42 and the float parameter 0.1234.
The result would be discarded.

Please see the reference guide on the GetSqlQuery method too.
Best wishes,
Thomas
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
OQL (OQL specific questions)
Asked by
Majid
Top achievements
Rank 2
Answers by
Thomas
Telerik team
Share this question
or