ASP. NET 2.0 allows you to easily develop database applications.

Source: Internet
Author: User

Preface:

ASP. NET 2.0 is attracted by its powerful functions and ultra-high efficiency. The originally complicated process is simplified to untrustworthy and easy, according to Microsoft, the official version of VS2005 in December will bring us a stronger Storm. After gradually deepening ASP. NET 2.0, I wanted to share my learning problems and experiences with you. Disclaimer: All the demo examples in this article are based on Visual Web Developer 2005 Express Beta2. Visual Web Developer 2005 Express Edition Beta2 is a simple, easy to learn and easy to use development tool, it focuses on Internet application development.

1. New Features of ASP. NET 2.0 database development:

Compared with previous versions, ASP. NET 2.0 has added more features, greatly improving the efficiency, management, scalability, and performance of developers.

In terms of development efficiency, ASP. NET 2.0 reduces the amount of code for a typical WEB application by 70%. You can implement the required functions without writing any code in some simple programs, the so-called "0 code ". This is because ASP. NET 2.0 encapsulates common Web tasks into application services and controls that can be easily reused between websites. Using these basic generation blocks is much less user-defined code than in earlier versions to implement many applications.

At the same time, many new server controls are introduced in ASP. NET 2.0 to provide powerful declarative support for data access, login security, wizard navigation, menus, tree views, portals, and so on. Many of these controls use the core application services of ASP. NET for data access, membership and role, and personalized settings.

New features in version 2.0 are as follows:

· Data Source Control-ASP. NET 2.0 introduces declarative data source controls that expose data from backend storage (such as SQL databases, intermediate layer business objects, or XML files) to the Data Binding UI controls on the page. The data source control also provides functions such as sorting, paging, caching, updating, inserting, and deleting data. The UI control can automatically use these functions without code.

· New data binding control-except ASP. except for the data binding control in NET 1.x, ASP. NET also includes new data binding UI controls such as GridView, DetailsView, FormView, TreeView, and Menu, which can be customized to display data in various formats. The GridView, DetailsView, and FormView controls can also automatically use the data source function, making it easy to add sorting, paging, and update operations to the data driver page.

· Data Control parameters-the data source can use the data control parameter objects in ASP. NET 2.0 to accept input parameters from various sources. Using these parameter objects, you can easily provide server control property values, sessions, applications, Cookie and querystring fields, and user configuration file attributes to parameterized data operations. With these parameters, you only need a small amount of custom code or no need to customize code to support filtering and master/detail schemes.

· Improved data binding syntax-for common solutions to bind controls to Data Binding templates, The DataBinder. Eval Data Binding syntax in ASP. NET has been simplified. You can also associate two-way data binding with control properties in the template to allow automatic transfer of values to the data source for update, insert, or delete operations. For Hierarchical XML data, ASP. NET 2.0 also contains an Xpath-based Data Binding syntax.

· Use the SQL Express local file database-to simplify development, ASP. NET 2.0 now supports the ability to connect to the SQL Express database as a local file in an application, eliminating the need to provide the database to the server for development purposes only. Of course, you can still connect to the server-based SQL database.

The following describes some important data binding controls and data source controls in detail:

· GridView:

This is a new data binding control in ASP. NET 2.0. It is the subsequent inheritance of the DataGrid Control in ASP. NET 1. x and has made many improvements based on it. Although the DataGrid Control in ASP. NET 1.x allows developers to process some operations, such as sorting, paging, editing, and deleting data through code. But when the GridViwe control is bound to the data source control, it can automatically sort, pagination, edit and delete a series of data processing. In terms of functionality, the GridViwe control also surpasses the DataGrid Control. The GridViwe control supports multiple key fields and provides powerful user customization functions on the UI interface, it also provides developers with a new model for canceling and processing events.

· SqlDataSource:

The SqlDataSource control represents a data source control that connects to the sqldatabase provider through ADO. NET. Like other data source controls, the SqlDataSource control can be bound to any data binding control that supports the performanceid attribute. At the same time, SqlDataSource has the ability to describe itself (such as selection, insertion, update, deletion, and sorting), and even the data binding control can automatically implement selection when these capabilities are allowed, insert, update, delete, sort, and so on. The SqlDataSource control allows you to replace the large amount of ADO required before creating database connections and implementing queries.. NET code. This is because the data query operation has been directly specified as an attribute of the data source control. Because the data query still exists in the page code, sometimes we call it a dual model.

The SqlDataSource control is usually intended for small and personal sites that do not need to query a large number of databases. When we develop a website with large data traffic, we must use the ObjectDataSource control, this is a data source control developed for large enterprises bound to the intermediate layer object.

This topic consists of four pages, currently on page 1 2 3 4


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.