Solved

Advantages of LINQ?

Posted on 2008-10-02
5
2,617 Views
Last Modified: 2013-11-12
Experts,

I'm new to LINQ like most people and can see its utility when it comes to smaller query jobs where a stored proc isn't needed.  Beyond that, I'm not sure what advantage it offers.  How easy is it to create re-useable LINQ?  How has the advent of LINQ affected database application design overall?

Thanks in advance for your input.
0
Comment
Question by:NigelRocks
  • 3
  • 2
5 Comments
 
LVL 69

Accepted Solution

by:
Éric Moreau earned 500 total points
ID: 22624738
LINQ is more then LINQ to SQL.

I love LINQ to objects. It allows me to filter/sort/... structures that don't offer those features otherwise (like arrays and collections).

I love LINQ to XML. XML document is a pain.
0
 
LVL 1

Author Comment

by:NigelRocks
ID: 22624969
Right.  Using it over an array is probably pretty useful.

What about reusability?

0
 
LVL 69

Expert Comment

by:Éric Moreau
ID: 22625186
I don't understand your concern on reusability!
0
 
LVL 1

Author Comment

by:NigelRocks
ID: 22625932
I don't want to have to write the same code over and over.  Embeded SQL has always had that problem, while stored procs and UDFs provided for modular, reusable code.  The only way I've seen that LINQ can do that is building dynamic LINQ functions.  Are there other ways?
0
 
LVL 69

Assisted Solution

by:Éric Moreau
Éric Moreau earned 500 total points
ID: 22626308
You are talking about LINQ to SQL again. This is the area of LINQ that I don't like. I am of the old-school that likes to have a business layer (filled by whatever method you like). Once your data is in your BL, chances are that this layer provides collections and other structures, LINQ is perfect on them.

I stay away from LINQ to SQL for real application whenener it is possible. It is wonderful in demo.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Latency in .net app using DB in .net 21 31
Capture logon name 13 42
Variable Event ? 3 23
Serach for record in Microsoft SQL Management Studio 8 20
JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now