08.01.2015 Views

Beginning Web Development, Silverlight, and ASP.NET AJAX

Beginning Web Development, Silverlight, and ASP.NET AJAX

Beginning Web Development, Silverlight, and ASP.NET AJAX

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

CHAPTER 4<br />

Data Binding with <strong>ASP</strong>.<strong>NET</strong><br />

Most applications use some form of data store, with the application itself being a<br />

means to store, retrieve, manipulate, <strong>and</strong> view data. These applications might use a SQL<br />

Server 2005 database, a storage area network, or even a simple XML file. <strong>Web</strong> applications<br />

are no exception, <strong>and</strong> typically these applications are termed data-driven applications.<br />

When it comes to retrieving <strong>and</strong> representing data, a myriad of options are available; over<br />

time, the technology has evolved dramatically. The reason for this is that the code needed<br />

to access data <strong>and</strong> the engines that run the data itself tend to be resource heavy, <strong>and</strong> in<br />

situations such as on the <strong>Web</strong> where they may be used in clustered environments (i.e.,<br />

the same application running on a number of machines) <strong>and</strong> serving millions of users,<br />

they can be expensive to maintain. As a result, the technology that developers use to create<br />

data-driven applications has evolved rapidly, driven by the needs of scaling to large<br />

audiences.<br />

.<strong>NET</strong> provides a data programming technology for you to use in your applications. It<br />

is called ADO.<strong>NET</strong>. It consists of a number of managed classes that enable your applications<br />

to connect to data sources, execute comm<strong>and</strong>s, <strong>and</strong> manage disconnected data. In<br />

this chapter, you’ll look at the architecture of ADO.<strong>NET</strong> <strong>and</strong> how it works to bring data to<br />

your application.<br />

You’ll look into the SQL Server 2005 Express edition, a free version of the industryleading<br />

enterprise database software from Microsoft, as well as a sample database,<br />

AdventureWorks, that is used to demonstrate many of its features.<br />

You’ll wrap the chapter up with a tour through some of the server controls that can<br />

be used to provide data awareness to your web application through data binding.<br />

What Is ADO.<strong>NET</strong><br />

Scalability is typically achieved by breaking an application into functional tiers. As I mentioned<br />

in the previous chapter, keeping state between tiers has a high cost when it comes<br />

to scalability, performance, <strong>and</strong> security. Data-aware applications are no exception.<br />

<strong>ASP</strong>.<strong>NET</strong> offers view state as a great alternative to maintaining control state between the<br />

browser <strong>and</strong> server to provide both a nice programming interface <strong>and</strong> control state management<br />

with minimum resource consumption. When writing data applications, the cost<br />

69

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!