Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 140325
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T07:35:40+00:00 2026-05-11T07:35:40+00:00

What is LINQ? I know it’s for databases, but what does it do?

  • 0

What is LINQ? I know it’s for databases, but what does it do?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T07:35:40+00:00Added an answer on May 11, 2026 at 7:35 am

    LINQ stands for Language Integrated Query.

    Instead of writing YAQL (Yet Another Query Language), Microsoft language developers provided a way to express queries directly in their languages (such as C# and Visual Basic). The techniques for forming these queries do not rely on the implementation details of the thing being queried, so that you can write valid queries against many targets (databases, in-memory objects, XML) with practically no consideration of the underlying way in which the query will be executed.

    Let’s start this exploration with the parts belonging to the .NET Framework (3.5).

    • LINQ To Objects – examine System.Linq.Enumerable for query methods. These target IEnumerable<T>, allowing any typed loopable collection to be queried in a type-safe manner. These queries rely on compiled .NET methods, not Expressions.

    • LINQ To Anything – examine System.Linq.Queryable for some query methods. These target IQueryable<T>, allowing the construction of Expression Trees that can be translated by the underlying implementation.

    • Expression Trees – examine System.Linq.Expressions namespace. This is code as data. In practice, you should be aware of this stuff, but don’t really need to write code against these types. Language features (such as lambda expressions) can allow you to use various short-hands to avoid dealing with these types directly.

    • LINQ To SQL – examine the System.Data.Linq namespace. Especially note the DataContext. This is a DataAccess technology built by the C# team. It just works.

    • LINQ To Entities – examine the System.Data.Objects namespace. Especially note the ObjectContext. This is a DataAccess technology built by the ADO.NET team. It is complex, powerful, and harder to use than LINQ To SQL.

    • LINQ To XML – examine the System.Xml.Linq namespace. Essentially, people weren’t satisfied with the stuff in System.Xml. So Microsoft re-wrote it and took advantage of the re-write to introduce some methods that make it easier to use LINQ To Objects against XML.

    • Some nice helper types, such as Func and Action. These types are delegates with Generic Support. Gone are the days of declaring your own custom (and un-interchangable) delegate types.

    All of the above is part of the .NET Framework, and available from any .NET language (VB.NET, C#, IronPython, COBOL .NET etc).


    Ok, on to language features. I’m going to stick to C#, since that’s what I know best. VB.NET also had several similar improvements (and a couple that C# didn’t get – XML literals). This is a short and incomplete list.

    • Extension Methods – this allows you to ‘add’ a method to type. The method is really a static method that is passed an instance of the type, and is restricted to the public contract of the type, but it very useful for adding methods to types you don’t control (string), or adding (fully implemented) helper methods to interfaces.

    • Query Comprehension Syntax – this allows you to write in a SQL Like structure. All of this stuff gets translated to the methods on System.Linq.Queryable or System.Linq.Enumerable (depending on the Type of myCustomers). It is completely optional and you can use LINQ well without it. One advantage to this style of query declaration is that the range variables are scoped: they do not need to be re-declared for each clause.

      IEnumerable<string> result =  from c in myCustomers  where c.Name.StartsWith('B')  select c.Name; 
    • Lambda Expressions – This is a shorthand for specifying a method. The C# compiler will translate each into either an anonymous method or a true System.Linq.Expressions.Expression. You really need to understand these to use Linq well. There are three parts: a parameter list, an arrow, and a method body.

      IEnumerable<string> result = myCustomers  .Where(c => c.Name.StartsWith('B'))  .Select(c => c.Name);` 
    • Anonymous Types – Sometimes the compiler has enough information to create a type for you. These types aren’t truly anonymous: the compiler names them when it makes them. But those names are made at compile time, which is too late for a developer to use that name at design time.

      myCustomers.Select(c => new  {   Name = c.Name;   Age = c.Age; }) 
    • Implicit Types – Sometimes the compiler has enough information from an initialization that it can figure out the type for you. You can instruct the compiler to do so by using the var keyword. Implicit typing is required to declare variables for Anonymous Types, since programmers may not use the name of an anonymous type.

      // The compiler will determine that names is an IEnumerable<string> var names = myCustomers.Select(c => c.Name); 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 190k
  • Answers 190k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Check out the official Microsoft forums May 12, 2026 at 5:55 pm
  • Editorial Team
    Editorial Team added an answer Looking at this doc, I would think multiplying tv_usec by… May 12, 2026 at 5:55 pm
  • Editorial Team
    Editorial Team added an answer The issue of pDataList's elements being adjacent in memory is… May 12, 2026 at 5:55 pm

Related Questions

What is LINQ? I know it's for databases, but what does it do?
What I'm doing works, but it's just wrong, I know it. public Profile GetProfile(int
I am calling a stored procedure through LINQ-to-SQL (yes, I know it's deprecated). I
Ok, I have a question that I know is very opinionated (based on all
I'm looking to learn LINQ, but I'm finding that there is a lot more

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.