Sign In | Subscribe
Start learning today, and be successful in your academic & professional career. Start Today!
Loading video...
This is a quick preview of the lesson. For full access, please Log In or Sign up.
For more information, please see full course syllabus of C#
  • Discussion

  • Study Guides

  • Table of Contents

Bookmark and Share

Start Learning Now

Our free lessons will get you started (Adobe Flash® required).
Get immediate access to our entire library.

Sign up for Educator.com

Membership Overview

  • Unlimited access to our entire library of courses.
  • Search and jump to exactly what you want to learn.
  • *Ask questions and get answers from the community and our teachers!
  • Practice questions with step-by-step solutions.
  • Download lesson files for programming and software training practice.
  • Track your course viewing progress.
  • Download lecture slides for taking notes.
  • Learn at your own pace... anytime, anywhere!

Querying Lists with LINQ

  • LINQ is used to retrieve data from a database, not to make changes to it
  • LINQ can query any source that implements the IEnumerable interface
  • The standard form is:
    • var [result] = from [variable] in [table]
      where [variable].[column] = [value]
      select [variable];
  • You can then use the variable in a loop:
    • foreach (var [variable] in [result])
      {
      [do something];
      }