Turn: ASP. NET database Programming (1)

Source: Internet
Author: User
Tags ole
Asp.net| Programming | data | database ASP. NET Database programming
7/17/2001 9:59:0 Pole new technology Studio Yesky




Asp. NET Ado.net and ADO in ASP, it is an improved version of ADO. In Ado.net, the application programming interfaces (APIs) provided by managed provider make it easy to access data from a variety of data sources, including databases supported by OLE DB and ODBC-supported.

Here are two of the most important concepts in Ado.net: Managed provider and Datasets.

Managed Provider

In the past, data access through ADO employs a two-tier, connectivity-based programming model. As demand for multi-tier applications grows, programmers need a connectionless model. Ado. NET was born. Ado. NET Managed provider is a multilayer structure of connectionless consistent programming model.

Managed Provider provides a link between a dataset and a data center, such as Ms SQL. Managed provider contains a series of interfaces that access the data Center (database). There are three main components:

1, the Connection object connection, command object commands, parameter object parameter provides the interface between data source and dataset. The DataSetCommand interface defines data columns and table mappings, and eventually retrieves a dataset.

2, the data flow provides a high-performance, forward data access mechanism. With IDataReader, you can easily and efficiently access the data stream.

3. The lower-level objects allow you to connect to the database, and then perform specific commands at the database-system levels.

In the past, data processing depended primarily on a two-tier structure and was based on connectivity. The connection is disconnected and the data is no longer accessible. Now, data processing is extended to more than three layers of structure, and, accordingly, programmers need to switch to a connectionless application model. In this way, DataSetCommand plays a very important role in ado.net. It can retrieve a dataset and maintain a "bridge" between a data source and a dataset for data access and modification and preservation. DataSetCommand automatically transforms the various operations of the data into appropriate SQL statements related to the data source. As can be seen from the figure, four command objects: SelectCommand, InsertCommand, UpdateCommand, DeleteCommand, respectively, replace the database query, insert, UPDATE, delete operations.

Managed provider uses local OLE DB to enable data access through COM interop. OLE DB supports automatic and manual transaction processing. Therefore, Managed provider also provides the ability of transaction processing.
DataSet

A dataset is the central concept of ado.net. You can imagine a dataset as a database in memory. It is precisely because of the dataset that programmers can screen the differences between databases in order to obtain a consistent programming model.

Datasets support multiple tables, inter-table relationships, data constraints, and so on. These and relational database models are basically the same.


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.