Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the Linq join data?

2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly introduces "what is Linq join data". In daily operation, I believe many people have doubts about what Linq connection data is. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful for you to answer the doubts of "what is Linq connection data?" Next, please follow the editor to study!

Linq join data (JOIN or GROUP JOIN):

You can combine multiple data sources into a From clause in several ways. The Join keyword is equivalent to INNER JOIN in SQL. It combines the two sets based on the matching key values between the elements in the two sets. For example: the following query for students whose last names begin with vowels:

Dim vowels () As String = {"A", "E", "I", "O", "U"} Dim vowelNames = From student In students, vowel In vowels _ Where student.Last.IndexOf (vowel) = 0 _ select Name = student.First & "" & _ student.Last, Initial = vowel _ Order By Initial

Or:

Dim vowelNames2 = From student In students _ Join vowel In vowels _ On student.Last (0) Equals vowel _ Select Name = student.First & "& _ student.Last, Initial = vowel _ Order By Initial

Linq join data is equivalent to LEFT OUTER JOIN in SQL, combining multiple collections into a single hierarchical collection.

You can use multiple Join clauses in a query to join two or more collections into a single collection.

Without using the Join clause, you can perform an implicit join to combine collections. To do this, include multiple In clauses in the From clause and specify the Where clause that identifies the key to be used for the join.

Full syntax:

Group Join element [As type] In collection _ On key1 Equals key2 [And key3 Equals key4 [...]] _ Into expressionList

Where expressionList is required and is one or more expressions that identify how groups of elements in the collection are aggregated. To identify a member name for the grouping result, use the Group keyword (= Group).

The Linq join data operation returns all the results in the collection identified to the left of the Linq join data operator. This is true even if there are no matches in the collection to be joined. This is similar to LEFT OUTER JOIN in SQL.

At this point, the study of "what is Linq join data" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report