asp.net.ph

Skip Navigation LinksHome > Data Access in Web Forms > Web Forms Data Model

Web Forms Data Model


Data access is the heart of any real-world application.

ASP.NET includes an extensive set of data access tools that makes it easier for developers to build applications that allow users to interact with databases in Web Forms pages.

There are essentially three groups of tools you will work with most often when building data-driven applications in ASP.NET:

In addition, the Web Forms framework implements a simple yet flexible data-binding model that enables different sources of data to be bound to Web Forms controls.

Attempting to understand all these technology at once can be overwhelming. So here we just briefly look first at how the technologies relate to each other.

Web Forms Controls, ADO.NET, Data Source Controls

Web Forms pages are the presentation tier of your Web application.

In the earliest version of ASP.NET, the Web Forms data model presumes that most data access by Web pages is read-only. In most cases, the user does not enter data that is written back to the data source.

Because most data access is read-only, the Web Forms data-binding architecture is one-way. That is, data binding displays data in controls, but does not write data from the controls to a data source.

One-way data binding makes Web Forms pages more efficient. Updating requires substantially more overhead in a page: the page must have available copies of the records to update and must include logic to update, insert, and delete records.

Because this overhead can add significantly to the page processing time and to server memory requirements, and because in most pages no updates are required, the default for Web Forms pages then is not to include a way to write data from a control to a data source.

If you are creating a page that updates a data source, you include the logic yourself to perform the update operations.

And this is where ADO.NET comes in. ADO.NET was the only available way to implement database connectivity in earlier versions of ASP.NET.

ADO.NET provided an enhanced interface for accessing, manipulating, and exchanging data in the .NET Framework, but still developers had to have some programming background.

Then ASP.NET 2.0 introduced data source controls, that simplify working with various types of data sources on a Web Forms page.

Data source controls can connect to and retrieve data from a database, an XML file, or a middle-tier business object, and make these data readily available for other controls to bind to, without requiring complex coding.

Moreover, data source controls have made it appreciably simpler to modify the underlying data source, with two-way databinding.

While this may seem be the do-it-all solution for some, there are situations where using data source controls may be impractical, or limited, and in these cases, knowledge of both ADO.NET and data source controls can help create efficient Web applications.

The succeeding topics discuss different data access scenarios, and show probable solutions using both approaches.

See Also

ADO.NET Primer



© 2025 Reynald Nuñez and asp.net.ph. All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note