In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly explains "what can LINQ to SQL do". Friends who are interested might as well take a look. The method introduced in this paper is simple, fast and practical. Let's let the editor learn "what can LINQ to SQL do?"
one。 LINQ to Objects
Both are supported as long as the IEnumerable or IEnumerable interfaces are implemented.
two。 LINQ to SQL (ADO.NET)
◆ LINQ to DataSet, LINQ to SQL and LINQ to Entities.
◆ LINQ to DataSet provides richer optimized queries for DataSet.
◆ LINQ to SQL can query the SQL Server database schema directly.
◆ LINQ to Entities can query the entity data model.
three。 LINQ to XML
LINQ can be seen as an improvement on the foreach loop:
1. They are more concise and easier to read, especially when filtering multiple conditions.
two。 They provide powerful filtering, sorting, and grouping capabilities with minimal application code.
3. They can be migrated to other data sources with no or only minor modifications. In general, the more complex the operations you have to perform on the data, the more benefits you will experience from using LINQ instead of traditional iterative techniques.
IV. LINQ to SQL:
1. LINQ requires that database tables must have primary keys.
two。 When you do the update operation, not only the primary key id=? is included in the where condition in the generated sql statement And includes and column2=? for each column in the table And column3=? . This is the rigor of LINQ's automatic generation of SQL statements to prevent multiple transactions from updating the same record in concurrency. If the A transaction updates the record, the B transaction update will fail.
3. Update cannot update the primary key.
4. The sql generated by skip (). Take () is actually: select count (*) from, and row_num () to achieve paging.
5. Efficiency is not as high as the direct use of T-SQL, feel suitable for small and medium-sized, the amount of data is not particularly large in development. And it may not be very convenient to use in combination with some controls in asp.net.
6. It is not as flexible as using T-SQL, especially more complex queries, multi-table joins, using case functions, and so on.
At this point, I believe you have a deeper understanding of "what LINQ to SQL can do". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.