Ado. Net introduction (from msdn)

Source: Internet
Author: User

ADO. NET is improved by Microsoft ActiveX Data Objects (ADO), which provides platform interuse and data access that can be shrunk. Because XML (Extensible Markup Language) is used for data transmission, any application that can read XML format can process the data. In fact, the receiving component does not need the ADO. NET component at all. It can be a Microsoft Visual Studio-based solution or any application running on any platform.

Programmable capability

With Visual Studio. NET, you can program your objects instead of tables and columns. Ado. net uses stronugly typed programming technology to highlight business objects.

For example, imagine the following line of code, using a traditional (rather than a strong type) programming method:

IF TotalCost > Table("Customer").Column("AvailableCredit")  

In this example, you are programming ADO tables and columns in a relational and abstract way.

Using a strongly typed programming method, the same example is much simpler:

IF TotalCost > Customer.AvailableCredit

In addition to easier reading, strong-type code is easier to write. In particular, the automatic statement completion function is very sensitive to the objects you are programming. In the following example, we can navigate between projects in our dataset. Intelligent awareness technology will display available tables related to customers.


Figure 1. Use intelliisense's strong-type Programming Technology

In addition, the type dataset runs faster during execution, because the application does not need to search for ADO set objects every time it needs to access design members.

Use Datasets

The center of any software solution using ADO. Net is a dataset. A dataset is a copy of the database data in the memory. A dataset contains many data tables. Each data table generally corresponds to a database table or view. A dataset forms a "disconnected" database data view. More precisely, the dataset exists in the memory and does not have a connection to the activity of the database containing the corresponding table or view. This disconnected architecture only uses database server resources when reading and writing databases, thus providing greater scalability.

During running, data is transmitted from the database to the business object in the middle layer, and then transmitted to the user interface. To adapt to the ADO exchange of data, ADO. net uses an XML-based temporary stay and transmission format. More precisely, to transmit data from one layer to another, the ADO. Net solution expresses memory data (datasets) in XML format and then sends XML to another component.

The following illustration shows the main components of An ADO. Net solution.


Figure 2. Architecture of ADO. net

To make it easier to use data in Visual Studio. NET, Visual Studio. NET has many new features. For XML developers in the core part, Microsoft has included a color-coded XML designer with the statement completion and identifier completion functions.


Figure 3. color-coded XML designer with statement and identifier completion

For a more graphical data view, developers can use the design view of the XML designer. You can drag and drop tables from any data source (including Microsoft SQL Server and Oracle Database) to the data surface. You can create a dataset composed of multiple data sources, including any XML file.


Figure 4. Ado. Net Dataset Designer

When designing your own applications, you often need to add, modify, or delete data. Using the data preview tab, you can not only add and modify data, but also manipulate the relationship between data.


Figure 5. Data Preview)

Visual Studio. NET's data binding technology has been greatly improved to make full use of ADO. net. It is now easier to create a user interface that interacts with data. More importantly, you can now bind data to Business Objects and XML network services.

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.