Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Advantages of LINQ?

Posted on 2008-10-02
5
Medium Priority
?
2,638 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 70

Accepted Solution

by:
Éric Moreau earned 2000 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 70

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 70

Assisted Solution

by:Éric Moreau
Éric Moreau earned 2000 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
It is possible to export the data of a SQL Table in SSMS and generate INSERT statements. It's neatly tucked away in the generate scripts option of a database.
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

971 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