. Net uses the record about Linq today, And. net uses linq today.

Source: Internet
Author: User

. Net uses the record about Linq today, And. net uses linq today.

 

I have been in touch with. net since my internship for more than half a year. Today, I have encountered a problem with LINQ in my project.

So I searched the internet and found out here to make it easier for me to view 0_0.

Language Integrated Query is a set of extensions for c # and Visual Basic languages.

It allows you to write C # Or Visual Basic code to query memory data in the same way as a database.

      

Some extensions that can be implemented by LINQ

Where, Max, Select, Sum, Any, Average, All, Concat, etc.

      

Small example on the Internet

List <int> arr = new List <int () {1, 2, 3, 4, 5, 6, 7 };

Var result = arr. Where (a =>{ return a> 3 ;}). Sum ();

Console. WriteLine (result );

Console. ReadKey ();

 

LINQ traversal DataTable filtering data

// All Student Information
DataTable stu_dt = new ClassDap (). GetAllXJ ();

    

// Query using the Select Method

String stuName = stu_dt.Select ("f_x133 = '" + "condition" + "'") [0] ["f_xm"]. ToString ();
String classId = stu_dt.Select ("f_xsid = '" + "condition" + "'") [0] ["f_bj"]. ToString ();

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.