In a SQL Server 2008 I have a simple stored procedure moving a bunch of records to another table:
CREATE PROCEDURE [dbo].MyProc(@ParamRecDateTime [datetime])
AS
using (dbContext db = new dbContext())
{
var parameters = new[]
{
new SqlParameter("@1","Input Para value"),
new SqlParameter("@2",SqlDbType.VarChar,4){ Value = "default if you want"},
new SqlParameter("@3",SqlDbType.Int){Value = 0},
new SqlParameter("@4","Input Para Value"),
new SqlParameter("@5",SqlDbType.VarChar,10 ) { Direction = ParameterDirection.Output },
new SqlParameter("@6",SqlDbType.VarChar,1000) { Direction = ParameterDirection.Output }
};
db.ExecuteStoreCommand("EXEC SP_Name @1,@2,@3,@4,@5 OUT,@6 OUT", parameters);
ArrayList ObjList = new ArrayList();
ObjList.Add(parameters[1].Value);
ObjList.Add(parameters[2].Value);
}