Experience the data access control in ASP.net 2.0

Source: Internet
Author: User
Tags object object web services visual studio
asp.net| Access | control | data Brief Introduction

Data access has been a key issue in developing WEB applications. Almost every business application needs a data-driven Web page. Because of the ubiquity of data access, it makes no sense for developers to constantly regenerate complex code for simple database tasks. Developers need to quickly access data from different data sources with varying formats. Fortunately, the new data access control and Ado.net 2.0 in ASP.net 2.0 solve the problem.

For traditional ASP and ASP.net 1.1 applications, developers have to create code to access and update the database, transforming the retrieved data into a browser-recognized HTML format. Although Visual Studio. NET Wizards can help with this task, there is still a need for complex synchronization between back-end code and front-end display to accomplish advanced features such as paging and sorting. Typically, such code is difficult to maintain and synchronize, especially if the database changes or when additional data needs to be displayed on the page. In addition, as a data store, XML needs to add a lot of code mixed with data access logic.

To improve developer productivity and WEB application performance, asp.net 2.0 controls data more flexibly with the functionality encapsulated in new data controls, reducing the code needed to access and display data. From traditional database to XML data storage, a variety of data sources can connect to these controls. All data sources are processed in a similar format, greatly reducing the complexity of developing data-driven applications. ASP.net 2.0 requires extensive architectural improvements to support these features from within. The new data source object adds a very reliable infrastructure through industry-approved best practices. Today, most complex applications can take advantage of the data access tools provided by ASP.net 2.0. The binding and caching issues that limit asp.net 1.x execution from the architecture and mechanism are resolved in ASP.net 2.0.

If you are an ASP developer, you will learn about ASP.net 2.0 's new data access features and Ado.net 2.0 data access model through this white paper. If you're a asp.net 1.1 developer, this white paper outlines Ado.net's new enhancements and data access models, and how to use ASP.net 2.0 's new data access controls to help you reduce the amount of code written to develop data-driven WEB applications.

data access for WEB applications

In the. NET Framework, data access is performed through the Ado.net API. The API provides an abstraction layer to encapsulate and hide the details of accessing the database directly, and these details are sometimes messy. ASP.net 2.0 Web applications are built on ado.net by providing services that automatically generate connections to various types of data, bind user controls to data, and reduce the number of code needed to develop data-aware WEB applications.

Data Access Architecture

For WEB applications in the. NET Framework, data access relies on two separate architectural layers. The first layer consists of the framework components required to perform data access. The second tier consists of APIs and controls that provide data access to programmers. From a practical standpoint, you just need to know if you can find a matching data provider for a particular data source.

Data access involves four major components: Web applications (asp.net), data tiers (ado.net), Data Provider, and the real data source. The relationships between these components form the infrastructure of all data-recognition Web applications.



Figure 1. Component Architecture

   Data Storage

The data store begins at the bottom of the stack, providing the basis for the entire data access architecture. With the new Controls Ado.net 2.0, ASP.net 2.0, Web applications have access to data from a variety of data stores, including relational databases, XML files, Web services, flat files, or data in spreadsheet programs such as Microsoft Excel. In fact, the actual data source has little to do with the mechanism used to read and manipulate the data.

Data Provider

Because of the provider model, Ado.net uses a set of classes and commands to interact with different data sources. A provider provides the ability to store and retrieve a particular data source by defining a set of interfaces and class hooks. The flexibility of this model allows developers to write only one set of data access codes (using ADO. NET) will be able to access multiple types of data.

In ASP.net 2.0, the provider model is actually used for a variety of different tasks in addition to basic data access. For example, use the new Personalized FeaturesYou rely on several types of providers when you store user data. As a result, the actual provider structure is functionally dependent. The purpose of a member provider differs from the purpose of the data access provider.

The following table shows the four core objects that comprise the Ado.net data provider:

Table 1. A description of the core object object of a ado.net data provider

Connection

Establish a connection to a specified resource

Command

Executes a command on a data source. Public Parameters, executed in the Connection Transaction scope.

DataReader

Read-only read-only data streams from one data source.

DataAdapter

Fills a datasetto resolve updates to the data source.


The provider model clearly separates the various uses. ASP.net developers can focus on building functional, ergonomic user interfaces, while the latter can achieve complex integration through existing enterprise-class data stores. Developing a WEB application using the ASP.net 2.0 provider model is an excellent choice.

[1] [2] [3] [4] [5] [6] Next page



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.