Chapter 10: Working with Data


Overview

In the two previous chapters, we've been looking at how Web Matrix can be used to create pages that display data from a database table, and even (briefly) at how we can build pages designed to allow data to be edited and updated. We examined the SqlDataSourceControl and the MxDataGrid control that Web Matrix uses to provide a complete environment for displaying data without requiring you to write any code.

In this chapter, we will move to the next stage of accessing data, where we no longer depend on the clever built-in controls that are part of the Web Matrix installation. Instead, we'll be using the controls that are an integral part of the .NET Framework. To use these controls, we need to be able to access data in a fundamentally different way – by writing some code. However, as you'll see, Web Matrix contains tools that can relieve us of the bulk of the effort required.

So, in this chapter, we'll look at:

  • How ASP.NET exposes data that we can use with a range of standard .NET controls

  • How we create code routines that can access a database and return data

  • How we select individual columns and return specific sets of rows from a database

  • How we can use some of the generic .NET Framework data controls to display data

Let's get started and think about how accessing data using code is different from using controls and drag-and-drop wizards.




Beginning Dynamic Websites with ASP. NET Web Matrix
Beginning Dynamic Websites: with ASP.NET Web Matrix (Programmer to Programmer)
ISBN: 0764543741
EAN: 2147483647
Year: 2003
Pages: 141

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net