Examining Database Fundamentals


You may have heard the term database used before but might not be completely clear about what a database is or what it is used for. In the simplest terms, a database is a collection of structured information that can be efficiently accessed and modified.

Databases contain data and allow four operations to be performed on that data: retrieval, insertion, modification, and deletion. Most commonly, databases are used as a means to retrieve already inserted data. Therefore, we will spend the bulk of our study of databases examining how to retrieve the database's data.

Before you can insert, update, delete, or query a database, you must first install the database software, create the database file, and define the structure of the data the database will hold. In this hour we will first examine the basic concepts of a database; after this, we will look at using Microsoft SQL Server 2005 Express Edition, a free database system that you installed along with Visual Web Developer back in Hour 1.

By the Way

We can access a database in a number of ways. Typically, database systems provide some sort of application to create databases and insert, delete, update, and access the database's data.

More interestingly from our perspective, we can access databases through an ASP.NET web page. This means that we can create an ASP.NET page that reads data from a database and displays its contents to the visitor. This approach is common in a vast number of real-world websites. For example, when you search for a book at Amazon.com, the search query web page retrieves matching records from a database and then displays these matching records in a resulting web page.

Over the next several hours we will examine how to display data from a database in an ASP.NET page.


After we've examined the fundamental properties and aspects of a database, we'll turn our attention to the syntax databases use for inserting, updating, deleting, and retrieving data. This language, referred to as Structured Query Language, or SQL, is the topic for the next hour.

Following this hour and the next, we'll focus on using various ASP.NET Web controls that are designed to access and display database data. For example, in Hour 14, "Accessing Data with the Data Source Web Controls," we'll examine ASP.NET's DataSource Web controls, which are a set of Web controls used for accessing, updating, inserting, and deleting database data. In Hours 15, "Displaying Data with the Data Web Controls," and 16, "Deleting, Inserting, and Editing Data," we'll see how easy it is to display and modify data using the GridView and DetailsView Web controls. In Hour 17, "Working with Data-Bound DropDownLists, RadioButtons, and CheckBoxes," we'll look at how to populate the contents of DropDownList, RadioButton, and CheckBox Web controls from data residing in a database. (Recall from Hour 11, "Collecting Input Using Drop-Down Lists, Radio Buttons, and Check Boxes," that the DropDownList, RadioButton, and CheckBox Web controls, along with the TextBox Web control, are Web controls designed for collecting user input.)

A Look at Current Database Systems

A slew of commercial and free database systems are available that will run on a variety of platforms. Some of the more popular commercial database systems include

  • Microsoft SQL Server http://www.microsoft.com/sql/

  • Oracle http://www.oracle.com/

  • IBM's DB2 http://www-3.ibm.com/software/data/db2/

  • Microsoft Access http://www.microsoft.com/office/access/

  • IBM's Informix http://www-3.ibm.com/software/data/informix/

These commercial database products are industrial-strength, suited for large companies with demanding data needs. Because these are such high-grade database systems, the costs can be quite high, in the tens of thousands of dollars.

Fortunately for us amateur developers, there are also a number of free database systems. These database systems are still impressive software accomplishments, but they lack the features and high performance that the commercial-grade database systems have. However, because we are just using these databases to test our ASP.NET pages, they more than meet our needs. Some of the more popular free databases include

  • PostgreSQL http://www.postgresql.com/

  • MySQL http://www.mysql.com/

  • Microsoft SQL Server 2005 Express Edition (MSDE) http://www.microsoft.com/sql/express/

Microsoft SQL Server 2005 Express Edition ships with Visual Web Developer; at this point you have already installed SQL Server 2005 Express Edition.

While we'll be using Microsoft SQL Server 2005 Express Edition for all of our database examples through the remainder of this book, don't think that ASP.NET pages can communicate only with Microsoft's own database software products. On the contrary, virtually any database system can be accessed through an ASP.NET page. So, if you or your company is already using a database system other than SQL Server 2005 Express Edition, don't worryyou can still work with that particular system. For the book's examples, though, I encourage you to follow along using SQL Server 2005 Express Edition.




Sams Teach Yourself ASP. NET 2.0 in 24 Hours, Complete Starter Kit
Sams Teach Yourself ASP.NET 2.0 in 24 Hours, Complete Starter Kit
ISBN: 0672327384
EAN: 2147483647
Year: 2004
Pages: 233

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