I want to be able to call a stored proc with named parameters in PetaPoco.
In order to call a stored proc that does a search/fetch:
Can I do something like this:
return db.Fetch<Customer>("EXEC SP_FindCust",
new SqlParameter("@first_name", fName),
new SqlParameter("@last_name", lName),
new SqlParameter("@dob", dob));
Also, how can I call a stored proc that does an insert?
return db.Execute("EXEC InsertCust @CustID = 1, @CustName = AAA")
Thanks, Nac
;
before the EXEC PetaPoco won't add the SELECT:.Execute(";EXEC InsertCust @C
– Industrialistdb.EnableAutoSelect = false
is the cleaner solution. – Thaumatrope