Wiley Beginning ASP.NET 1.1 with Visual C# .NET 2003 978-0-7645-5708-8 ユーザーズマニュアル

製品コード
978-0-7645-5708-8
ページ / 36
8
Reading from Databases
So far, you've learnt a lot about programming, and seen those techniques in use in a variety of Web
pages. Now it's time to turn our attention to one of the most important topics of building 
Web sites – data. Whatever the type of site you aim to build, data plays an important part. From a
personal site (perhaps a vacation diary or a photo album), to a corporate e-commerce site, 
data is key!
There are numerous ways to store data, but most sites use a database. In this chapter, we're going to
look at data stored in databases, and show how easily it can be used on Web pages. For this we are
going to use ADO.NET, which is the data access technology that comes as part of the .NET
Framework.
If the thought of databases sounds complex and scary, don't worry. We're going to show you just
how easy this can be. In particular, we'll be looking at:
Basics of databases and how they work
How to create simple data pages using Web Matrix
Different ADO.NET classes used for fetching data
Basics of ADO.NET and how it fetches data
How to use Web Matrix to simplify developing data access pages
Let's develop some basic understanding of databases first.
Understanding Databases
Understanding some basics about databases is crucial to using data in your pages. You don't need
to be a database expert, but there are certain things you will need to know in order to work with
data in .NET. For a start, you need to understand how data is stored. All types of data on a
computer are stored in files of some sort. Text files, for example, are simple files and just contain
57084_08.qxp  30/01/2004  8:02 PM  Page 247