In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article will explain in detail how to make better use of ADO.NET access technology. The editor thinks it is very practical, so I share it with you as a reference. I hope you can get something after reading this article.
This is our .NET support. Our direction is to provide a comprehensive functional access. So the answer to your question is yes. We will support .NET according to the needs of our users, and take a look at all the content provided by the Windows Development Center on the Oracle technology website. ADO.NET is very proactive in visiting us.
If you only retrieve the data and do not need to update the data, you can cancel change tracking by using MergeOption.NoTracking. In this way, ObjectStateManager will not be used, reducing the time it takes to execute the query, and all returned entities will be in a separate state (detached state). NoTracking is a better choice when displaying data as read-only in ASP.NET web application or in WinForms / WPF Grids controls.
When using object Services (Object Services) and ADO.NET access, you need to call an overloaded constructor of ObjectQuery, where the third parameter is the MergeOption enumeration. The default behavior is AppendOnly, which can be changed to NoTracking.
Product product1 = context.Product.FirstOrDefault (p = > p.ProductID = = 1004); if (product1! = null) {product1.Color = "Black"; product1.StandardCost = 20; product1.ListPrice = 25;} var objectStateEntries = context.ObjectStateManager.GetObjectStateEntries (EntityState.Modified) Foreach (var entry in objectStateEntries) {Console.WriteLine ("{0}-{1}-{2}", entry.EntityKey.EntityContainerName, entry.EntityKey.EntitySetName.ToString (), entry.EntityKey.EntityKeyValues.First (). Key + "=" + entry.EntityKey.EntityKeyValues.First () .value); for (int I = 0; I
< entry.OriginalValues.FieldCount; i++) { Console.WriteLine("\t {0} ->{1} ", entry.OriginalValues [I], entry.CurrentValues [I]);}}
In the following example, you first retrieve a specific Product record, modify three of its properties, call the GetObjectStateEntries (EntityState.Modified) method, return a list of all updated entities, and further iterate through the ObjectStateEntry collection, showing the entity name, ADO.NET access, initial value, and current value.
This is the end of this article on "how to make better use of ADO.NET access technology". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.
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.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.