Cross-era improvement: ado.net introduction (FIG)

Source: Internet
Author: User
The cross-era improvement of ADO: Ado.net Introduction (FIG)



Ado. NET is a cross-era improvement of Microsoft ActiveX data Objects (ADO), which provides platform interoperability and scalable data access. Because the data is sent in XML format, any application that can read XML format can do data processing. In fact, the component that accepts data is not necessarily ADO. NET component, which can be based on a Microsoft Visual Studio solution or any application running on other platforms.

Programmability

With Visual Studio.NET, you can program your object, not a data table or a data column. Ado. NET with strong type programming, can better describe the business object.

For example, traditional programming (not strongly typed) is used in the following lines of code

IF totalcost > Table ("Customer"). Column ("Availablecredit")

In this example, the ADO tables and columns are programmed in an associative, abstract way.

If you are using strongly typed programming, things will be much simpler:

IF totalcost > Customer.availablecredit

In addition to being able to read easily, strongly typed code is easier to write. In particular, you can also identify objects that you write by automatically filling out the sentences. As you can see in the following example, using IntelliSense (Intelligent induction) technology, you can easily find the table related to customers.


Figure I. Strongly typed programming and IntelliSense

In addition, a strongly typed dataset has a higher execution speed because the application does not have to look in the ADO object collection every time the data member is accessed.

Using data Set (DataSet)

The most important thing in any application that uses Ado.net is the dataset. A dataset is a copy of the database data in memory. A dataset can contain any number of data tables, each of which is typically corresponding to a table or view in a database. The dataset consists of a disconnected database data view. In other words, it is in memory and does not maintain an active connection with the database that contains the corresponding table or view. This disconnected architecture makes it possible to use database server resources only when reading and writing to the database, thus providing better scalability.

At run time, the data is fetched from the database and passed first to a middle-tier business object and then to the user interface. To accommodate this data interchange, ADO. NET takes the form of an xml-based, continuous delivery format. In other words, when data is passed from one layer to another, ADO. NET scheme is to express the data in memory (that is, the dataset) as XML, and then pass it to other components in XML format.

The following figure is the main component of the Ado.net solution.


Figure Two. Ado. NET Architecture

To facilitate processing of data, Visual Studio.NET adds a number of new features. For advanced XML Developers, Microsoft provides a color-labeled XML Designer that has the ability to write statements automatically and tag automatically.


Figure Three. XML Designer with color identification, statement complement, and label complement

If you want a more graphical view of your data, developers can use the Design view of the XML Designer: Just drag the data source, including Microsoft SQL Server and Oracle databases, to the design interface, and you can do it easily. You can use any data source, including an XML file, to create your dataset.


Figure Four. Ado. NET DataSet Designer

Typically, you need to add, modify, or delete data to develop your application. With Data preview tags, you can not only add modified data, you can also manipulate the relationship between the data.


Figure Five. Data preview

Data binding technology has been greatly improved in Visual Studio.NET to give full play to the advantages of ado.net. Building a user interface that interacts with the data becomes simpler. More importantly, you can bind values to business objects and XML Web 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.