Use COM + in C # To implement transaction control wirte (original) (I switched to)-Windows development-. NE

Source: Internet
Author: User

Use COM + in C # To implement transaction control wirte (original)

Keyword c #, com +, transaction control

Use COM + in C # To implement transaction control
. NET technology is the next-generation platform technology that Microsoft vigorously promotes. Since the formal release of. NET Technical Architecture Beta2, this technology has gradually become mature and stable. According to Microsoft's platform system share, we can easily imagine that in the next year or two. NET technology is bound to become a mainstream technology platform, and the most important premise for a new technology platform to develop rapidly is: he will not abandon the previous technology completely, this is true. NET technology refers to the COM/COM + technology.

In general, in the IT technology field and hardware industry, the technology upgrading speed is amazing, and the practice is that all new technologies will follow the principle of backward compatibility,. NET technology does not only achieve this ,. NET and even implement their respective calls, which is very valuable. That is to say, we can not only call the COM component in the. NET component, but also call the. NET component normally in the COM component. The benefits of this point are obvious. On the one hand, we can maintain the existing technical resources, and on the other hand, we can use various new technologies brought about by. NET in the existing resources.

General database transaction control requires that the operations performed in the transaction must be performed in the same database so that RllBack can be rolled back to the initial State when an error occurs. This is a problem. In distributed applications, we often need to operate multiple databases at the same time and use the transaction processing of the database itself, which is difficult to meet the transaction control requirements of the program. COM + provides a complete transaction service, which can be used to control transactions in distributed applications.

The procedure is as follows:

1. Use VS. NET to generate a class library.

2. Add a reference to System. EnterpristServices. Detailed steps
Menu: (Project-add reference-on the. NET tab, select System. EnterpristServices-OK)

Iii. Build class

1: source program

Using System;
Using System. EnterpriseServices;

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.