In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly explains "what is the use of ADO.Net Sql", the content of the explanation is simple and clear, easy to learn and understand, the following please follow the editor's ideas slowly in depth, together to study and learn "what is the use of ADO.Net Sql"!
System.Data.SqlClient namespace includes the SqlTransaction class. This class includes two properties:
◆ Connection: indicates the SqlConnection object associated with the transaction
◆ IsolationLevel: defines the ADO.Net Sql of the transaction.
The property IsolationLevel is an enumerated object that includes the following members:
◆ Chaos: pending changes that emerges from highly independent transactions cannot be overwritten
◆ ReadCommitted: shared locking (shared locks) is used when data needs to be read non-maliciously, but the data can still be updated at the end of the transaction, resulting in non-repetitive data reads (nonrepeatable reads) or phantom data
◆ ReadUncommitted: malicious data reading is possible, which means that shared locking (shared locks) is not used and exclusive locking (exclusive locks) is not implemented.
◆ ADO.Net Sql: locks all data used in the query to prevent other users from updating the data. This avoids non-repetitive data reading (nonrepeatable reads) when phantom rows is still available
◆ Serialisable: scope locking in DataSet to prevent other users from updating data or inserting rows in the database before the end of the transaction
◆ IsolationLevel defines the level at which records are locked, but this concept is beyond the scope of this article. The object SqlTransaction provides a similar method. You can use the following methods to handle transactions
◆ Commit: commit database transactions
◆ ADO.Net Sql: unresolved state (pending state) reversal (roll back) transaction. This operation cannot be performed once the transaction has been committed
◆ Save: creating a savepoint in a transaction reverses part of the transaction and specifies the savepoint name.
Creating an ADO.NET service is very simple, and it is only a small exhibition of the standard code. As long as you know how to use ADO.NET to run problem databases, you almost know. Identification is just that you need to put the code in the context of a service.
Or the original ADO.Net Sql database reference, introduce System.Data and System.Data.SqlClient database in the implementation of the service, in order to perform a task, you need to create a SqlTransation object, you can use your SqlConnection object BeginTransation () method to build it, once you save the SqlTransation object as a local parameter, you can give it to your SqlCommand object business, or use it as a parameter for the creator to create SqlCommand. Before performing the SqlCommand action, you must use the BeginTransaction () method and then issue it to the SqlCommand.
Thank you for your reading, the above is the content of "what is the use of ADO.Net Sql", after the study of this article, I believe you have a deeper understanding of what is the use of ADO.Net Sql, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
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.