Chapter 12

Introducing Databases

What You Will Learn in This Chapter:

  • What a database is and which databases are typically used with ASP.NET pages
  • What SQL is, how it looks, and how you use it to manipulate data
  • What database relationships are and why they are important
  • Which tools you have available to manage database objects (such as tables) and how to use them Code Downloads for this Chapter

You can find the code downloads for this chapter on the Download Code tab at The code is in the Chapter 12 download.

Being able to use a database in your ASP.NET websites is just as critical as understanding HTML and CSS: it's almost impossible to build a modern, full-featured website without it. Databases are useful because they enable you to store and retrieve data in a structured way. The biggest benefit of databases is that you can access them at run time in your site, which means you are no longer limited to just the relatively static files you create at design time in Visual Studio. You can use a database to store reviews, musical genres, pictures, information about users (usernames, e-mail addresses, passwords, and so on), log information about who reads your reviews, news articles, and much more, and then access that data from your ASPX pages.

This gives you great flexibility in the data you present, and the way you present it, enabling you to create highly dynamic websites that can adapt to your visitors' preferences, ...

Get Beginning ASP.NET 4.5: in C# and VB now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.