What is LINQ?
The official Chinese name for LINQ is ". NET language Integration query," which is all called language-integrated query. It provides traversal, filtering and projection functions similar to SQL syntax, and is the most important new technology in the Visual Studio orcas&.net Framework 3.5. Not only does LINQ complete queries on objects, it can manipulate the database through DLinq, or control XML through XLinq. Both Visual Basic 9 and C # 3.0 fully support LINQ. Now we can show the exciting new features of LINQ through a small piece of code.
LINQ Example 1
Dimlistasstring () ={"abc", "Def", "Ght"}
' Did you see that? '
dimresult=fromtasstringinlistwheret= "ABC"
' Output data, result type is IEnumerable (Ofstring)
Console.Write (Result (0))
Here, I used a part of the syntax sugar in Visual Basic 9 to simplify the code.
LINQ Advanced Application
In fact, there are differences between LINQ and T-SQL, such as from predecessors, and Select at the end. Although this is based on the IDE's IntelliSense considerations, it still feels slightly uncomfortable. LINQ also supports a large number of SQL syntax, such as ORDERBY,GROUPBY, and a batch of statistical functions such as AVG, Sum, Count, and so on. You can explore the rest of the section yourself. Of course, you first want to download and install Visual Studio Orcas Beta 1.
Restudying
Visual Basic 9 Incomplete Introductory series (1): Grammar candy
Visual Basic 9 Incomplete Getting Started series (2): Syntax enhancement
Conclusion
LINQ is worthy of the core enhancements in. Net Framework 3.5, and the performance of LINQ is already evident, combined with the support of anonymous types. For some time to come, I think it should be an important technology in the. Net World. You can also take a look at some of the information listed in the article to help you explore LINQ further. At the same time, this essay also experienced a twists and turns, because in the upcoming release, keyboard problems, resulting in the second half of the essay is lost, unable to recover, had to hastily received pen.