ADO .NET Introduction (from MSDN)

xiaoxiao2021-03-06  73

ADO .NET is improved by Microsoft ActiveX Data Objects (ADO), which provides platform interoperability and contractual data access. Due to the XML (Extensible Markup Language, the extensible label language) is a format for data transfer, any application that can read an XML format can be processed. In fact, the receiving component does not require ADO.NET components at all. It can be a solution based on Microsoft Visual Studio or any application running on any platform.

Programmable ability

With Visual Studio .NET, you can program your objects instead of programming tables and columns. ADO .NET uses a stronger type programming technology that highlights business objects.

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

If Totalcost> Table ("Customer"). Column ("Availablecredit")

In this example, you are programming ADO tables and columns in an relational, abstract approach.

Using a strong type of 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 feature is very sensitive to the objects you are programming. In the following example, we can navigate between items in our data set, intelligent sense, will display available forms associated with Customers.

Figure 1. Strong type programming technology using IntelliSense

In addition, the type data set is run faster when executed because the application needs to access the design member each time, there is no need to search for the ADO collection object.

Use data set

The center of any software solution using ADO.NET is a data set. The data set is a copy of the database data in memory. A data set includes a number of data tables, each of which is generally corresponding to a database table or view. A data set consists of a view of "disconnected" database data. It is more accurate, and the data set is in memory, and there is no connection to the activity of the database containing the corresponding table or view. This disconnected architecture is only using database server resources when reading and writing the database, thereby having greater receptor.

When running, the data passes from the database to the intermediate business object, and then proceeds it to the user interface. In order to adapt to the exchange of data ADOs, ADO .NET uses an XML-based piping and transmission format. It is more accurate, in order to transfer data from one layer to another, the ADO.NET solution represents memory data (dataset) 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, there are many new features in Visual Studio .NET. For the XML developers of the core part, Microsoft has included a color code XML designer with statement completion and identifier completion.

Figure 3. Color code XML designer with statement and identifier completion function

For a more graphic data view, developers can use the XML designer design view. A table you can simply in any data source (including Microsoft SQL Server, and Oracle Databases) is dragged from Server Explore to the data surface. You can create a data set consisting of data from multiple data sources, including any XML files.

Figure 4. ADO .NET Data Set Designer

When you design your application, you often need to add, modify, or delete data. Use the Data Preview tab, you can not only add and modify data, but also manipulate the relationship between data. Figure 5. Data Preview (Data Preview)

Visual Studio .NET's data binding technology has been greatly improved to take advantage of ADO.NET. The user interface created to interact with the data is now easier. More importantly, now you can bind your data to your business objects and XML network services.

转载请注明原文地址:https://www.9cbs.com/read-109513.html

New Post(0)