Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
BOOK: Beginning ASP.NET 4 : in C# and VB
This is the forum to discuss the Wrox book Beginning ASP.NET 4: in C# and VB by Imar Spaanjaars; ISBN: 9780470502211
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 4 : in C# and VB section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old March 16th, 2012, 12:18 AM
Friend of Wrox
Points: 1,905, Level: 17
Points: 1,905, Level: 17 Points: 1,905, Level: 17 Points: 1,905, Level: 17
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2011
Posts: 411
Thanks: 13
Thanked 7 Times in 7 Posts
Default The outer and inner join LINQ question.

Reading through Chapter 14 of your book, I was wondering how does LINQ simulate or emulate inner and outer joins? How does interact and interface with stored procedures?

Thanks once again!
  #2 (permalink)  
Old March 16th, 2012, 05:21 AM
Imar's Avatar
Wrox Author
Points: 70,322, Level: 100
Points: 70,322, Level: 100 Points: 70,322, Level: 100 Points: 70,322, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

Google is your friend:

101 LINQ Examples including JOIN Syntax: http://code.msdn.microsoft.com/101-L...mples-3fb9811b

LINQ itself doesn't do stored procedures as it's only a query language. However, Entity Framework and LINQ to SQL do support it:

EF: www.google.com/?q=EF+stored+procedures
L2S: www.google.com/?q=LINQ+to+SQL+stored+procedures

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
  #3 (permalink)  
Old September 13th, 2012, 11:34 PM
Authorized User
Points: 276, Level: 5
Points: 276, Level: 5 Points: 276, Level: 5 Points: 276, Level: 5
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2012
Posts: 39
Thanks: 4
Thanked 1 Time in 1 Post
Default LINQ in the Entity Framework (Chapter 14)

Hello,

Following on vbboyd's question about no join examples in Chapter 14 ...

I have used LINQ-To-SQL once before, but was under the impression that, although the syntax is similar for LINQ in the Entity Framework, it still is different. Is the syntax, in fact, the same? (the weblink Imar gave doesn't explicitly mention Entity Framwork). In other words, are LINQ statements the same across any type of LINQ-To-X

Here is my conceptual understanding. Someone please advise if this is correct: By adding the .Include() method after the entity, you are in effect doing an Inner Join, as now you have access to the related rows in the "included" entity. I am fuzzy on how you would perform the outter join unless it's the same as LINQ-To-SQL.

Thanks everyone.
  #4 (permalink)  
Old September 16th, 2012, 09:59 AM
Imar's Avatar
Wrox Author
Points: 70,322, Level: 100
Points: 70,322, Level: 100 Points: 70,322, Level: 100 Points: 70,322, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Quote:
Is the syntax, in fact, the same?
Yes, LINQ as a query language is a stand alone concept that can be used by, for example, L2S and LINQ to Entities. The query language itself is the same in both implementations although the methods they support can be different. Also, managing objects (creating new ones for example) is different because that's not a LINQ feature but an ORM feature.

For an example of an OUTER JOIN with LINQ

http://www.hookedonlinq.com/OuterJoinSample.ashx

And yes, by calling Include you get an INNER JOIN although you don't have to use Include to use an INNER JOIN.

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
  #5 (permalink)  
Old September 16th, 2012, 07:01 PM
Authorized User
Points: 276, Level: 5
Points: 276, Level: 5 Points: 276, Level: 5 Points: 276, Level: 5
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2012
Posts: 39
Thanks: 4
Thanked 1 Time in 1 Post
Default LINQ Concepts

This is a good post; it's important to understand the concepts behind the tools and implementations. Now I understand why LINQ-To-SQL seemed different than LINQ-To-Entities.

Different methods are exposed, and different constructs are used to manage data objects, depending on which you are using, but the language is the same.

This sheds some clarity on the subject. Thank you.


Similar Threads
Thread Thread Starter Forum Replies Last Post
Logical issue in 'Outer join', why out join is not working, the way it should? arbab Oracle 5 March 7th, 2011 09:22 AM
left outer join rokitsalad LINQ 0 January 21st, 2009 11:05 AM
left outer join keyvanjan Classic ASP Basics 1 April 15th, 2006 05:37 AM
Outer Join, 2 columns jking SQL Language 1 December 5th, 2004 04:14 AM
outer join on same table roog SQL Language 4 September 30th, 2004 05:31 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.