Stored procedures - retrieving output parameters using SqlHelper?
I've added a couple of tables to my Umbraco database to store "orders" and "order lines" on a website. I've added a stored procedure to the DB which adds a new order, and returns the new order ID as an output parameter.
What's the best way to run this stored procedure and retrieve the value of the output parameter? Is it possible to do with the Umbraco SqlHelper?
The SqlHelper is nice to use in packages so it's compatible with all Umbraco installs, but for custom work I usually use ORM. I use LLBLGen for almost all our projects.
Hi Jeroen - I'll definitely take a look at that, but for the project I'm working on, it's a bit overkill - I just need a couple of extra tables and a couple of stored procedures. Do you know if SqlHelper can manager output parameters?
I don't think (pretty sure) this is not built in for the the SqlHelper. What you can do is use the normal SqlConnection/SqlCommand objects then you can use output parameters.
Stored procedures - retrieving output parameters using SqlHelper?
I've added a couple of tables to my Umbraco database to store "orders" and "order lines" on a website. I've added a stored procedure to the DB which adds a new order, and returns the new order ID as an output parameter.
What's the best way to run this stored procedure and retrieve the value of the output parameter? Is it possible to do with the Umbraco SqlHelper?
Cheers,
Mike
The SqlHelper is nice to use in packages so it's compatible with all Umbraco installs, but for custom work I usually use ORM. I use LLBLGen for almost all our projects.
Jeroen
Hi Jeroen - I'll definitely take a look at that, but for the project I'm working on, it's a bit overkill - I just need a couple of extra tables and a couple of stored procedures. Do you know if SqlHelper can manager output parameters?
Mike
Hi Mike,
I don't think (pretty sure) this is not built in for the the SqlHelper. What you can do is use the normal SqlConnection/SqlCommand objects then you can use output parameters.
Cheers,
Richard
is working on a reply...