Calling Stored Procedure with Out Parameter

Calling Stored Procedure with Out Parameter

Postby pradeepdaasari » Thu 02 Jun 2011 12:50

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
pradeepdaasari
 
Posts: 2
Joined: Thu 02 Jun 2011 12:42

Re: Calling Stored Procedure with Out Parameter in EF

Postby pradeepdaasari » Thu 02 Jun 2011 12:54

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
pradeepdaasari
 
Posts: 2
Joined: Thu 02 Jun 2011 12:42

Postby AndreyR » Thu 02 Jun 2011 16:01

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:
Code: Select all
using(MyEntities context = new MyEntities()) {
  int? par = null;
  context.MyStoredProc(ref par);
}
AndreyR
Devart Team
 
Posts: 2919
Joined: Mon 07 Jul 2008 13:16


Return to dotConnect for Oracle