[How Do I:] LINQ to SQL: Using Stored Procedures

Please install Silverlight or click download to watch video locally.

Using existing stored procedures and functions is easy with LINQ. We simply drag the stored procedures onto the O/R mapping surface and call them from the generated Data Context object.

Presented by Scott Stanfield

Duration: 9 minutes, 18 seconds

Date: 10 January 2008

Watch    Video   |   Download    Video    C# Code

Video downloads: WMV  |  Zune  |  iPod  |  PSP  |  MPEG-4  |  3GP

Audio downloads: AAC  |  WMA  |  MPEG-4  |  MPEG-3  |  MPEG-2

Comments : 16

Leave a Comment

przemeklach : On March 25, 2008 12:51 AM said:

Hi,

Couple questions:

It seems like you can make powerful queries without using stored procedures, at what point do you decided to use stored procedures?

Does using LINQ break the MVC model? It seems like you are mixing parts of the controller with the model.

Thanks

grimrist : On July 10, 2008 2:20 PM said:

I use stored procedures mainly because we have them created already. I would imagine only using stored procedures if they are available and are at your disposal. Why reinvent the wheel when they are already there for you.

Myself on the otherhand, likes to reinvent the wheels.

cv_vikram : On August 18, 2008 10:56 AM said:

thanks....

iscott : On August 28, 2008 1:52 AM said:

The major reason for using stored procedures is that they execute quicker that the equivalent in-line query. This is because SQL Server has the opportunity to work out the best execution plan ahead of the time when the stored procedure will be called by the application.

S.Pirashanth : On August 28, 2008 5:05 AM said:

Many thanks for the great videos

vinz : On October 17, 2008 5:51 PM said:

Great video! Thank you!

djibril_chimere_DIAW : On October 24, 2008 7:43 AM said:

Thanks! Jërëjëf!

alexchr : On October 28, 2008 5:15 PM said:

hi,

6:45 : The return values is a collection of Produt objects...

so instead of using

foreach(var p in q) which works anyway

you can use

foreach(product p in q)...  

thanx for the videos and source codes, nice place to start from!

rami_nassar : On December 09, 2008 11:57 AM said:

thats what i was seeking for

agrawalbs : On January 28, 2009 3:17 PM said:

trying to download for last two days but not able to do it.

prolingua.geo : On February 09, 2009 10:42 AM said:

thanks for the video

uniquesaiful : On February 22, 2009 5:43 AM said:

Cool video. Thanks

vvphan : On February 25, 2009 3:46 PM said:

Thanks

sisieko : On March 13, 2009 11:34 PM said:

I am not comfortable with the idea of hard coding sql statements on my aspx pages, i think stored_procedures are best way to go.

amin_pucit : On April 24, 2009 12:57 PM said:

nice work!

DotNetXenon : On September 04, 2009 7:01 PM said:

Thanks for the great video!!!

Leave a Comment

You must be logged in to leave a comment. Click here to log in.

Microsoft Communities