How To Call Stored Procedure In C# That Has Output Parameters



TODO:

Have you ever wanted to call a stored procedure in C# that has output parameters?

 

SOLUTIONS:

System.Data.Objects.ObjectParameter param1 = new ObjectParameter("paraminsp1", typeof(bool));
System.Data.Objects.ObjectParameter param2 = new ObjectParameter("paraminsp2", 0.000);           //default so EF works

using (MyEntities MyDatabase = new MyEntities())
{
     MyDatabase.sp_name(x, 2, param1, param2);
}

 

NOTES:

There are no notes on this topic



Add comment

  Country flag

biuquote
  • Comment
  • Preview
Loading