Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it Possible to call a Stored Procedure using LINQ in LINQPad?

Tags:

In visual studio you have the nice designer that encapsulates a stored proc with a nifty little method. I totally love LINQPad and use it on a daily basis at work (haven't had a need to open up SQL Studio for my job since I've been using it!) and would like to call stored procs while using it.

I'm afraid I know the answer to my own question but I'm hoping that maybe there's a feature I'm missing or perhaps someone has some black magic they can lend me to make this happen. Btw, I'm using LINQPad 4 if that makes a difference.

Edit
See my answer below.

like image 617
Jeff LaFay Avatar asked Nov 10 '10 21:11

Jeff LaFay


People also ask

Is LINQ better than stored procedure?

Stored procedures are faster as compared to LINQ query since they have a predictable execution plan and can take the full advantage of SQL features. Hence, when a stored procedure is being executed next time, the database used the cached execution plan to execute that stored procedure.


1 Answers

At least in my copy of LINQPad, stored procedures show up in the database treeview and can be invoked directly.

Here's a screenshot:

Screenshot

like image 113
Daniel Pryden Avatar answered Sep 20 '22 17:09

Daniel Pryden