Hi,
Can any one please explain how can i execute the stored procedure with out parameter?
I have added the stored procedure in the functions in my context,i have selected the returned collection type as None. If i select the None stored procedure is not getting available in the context.
Please provide the solution.
Thanks,
Pradeep
Calling Stored Procedure with Out Parameter
-
- Posts: 2
- Joined: Thu 02 Jun 2011 12:42
-
- Posts: 2
- Joined: Thu 02 Jun 2011 12:42
Re: Calling Stored Procedure with Out Parameter in EF
pradeepdaasari wrote:Hi,
Can any one please explain how can i execute the stored procedure with out parameter in entity framewrok?
I have added the stored procedure in the functions in my context,i have selected the returned collection type as None. If i select the None stored procedure is not getting available in the context.
Please provide the solution.
Thanks,
Pradeep
Use the following steps:
1. Add the Devart Entity model to your project. Select the necessary procedure in the DB Objects tree.
2. Go to Model Explorer, find this procedure in the Model.Store->Stored Procedures node, and drag this procedure onto the designer surface.
3. Call this procedure using a code as in the following example:
1. Add the Devart Entity model to your project. Select the necessary procedure in the DB Objects tree.
2. Go to Model Explorer, find this procedure in the Model.Store->Stored Procedures node, and drag this procedure onto the designer surface.
3. Call this procedure using a code as in the following example:
Code: Select all
using(MyEntities context = new MyEntities()) {
int? par = null;
context.MyStoredProc(ref par);
}