03.11.2016 Views

Beginning ASP.NET 4.5 in CSharp and VB Opsylum

Create successful ePaper yourself

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

12<br />

Introduction to Databases<br />

WHAT YOU WILL LEARN IN THIS CHAPTER:<br />

‰ What a database is <strong>and</strong> which databases are typically used with <strong>ASP</strong><br />

.<strong>NET</strong> pages<br />

‰ What SQL is, how it looks, <strong>and</strong> how you use it to manipulate data<br />

‰ What database relationships are <strong>and</strong> why they are important<br />

‰ Which tools you have available to manage database objects (such as<br />

tables) <strong>and</strong> how to use them<br />

WROX.COM CODE DOWNLOADS FOR THIS CHAPTER<br />

You can f<strong>in</strong>d the wrox.com code downloads for this chapter on the Download Code tab at<br />

www.wrox.com/remtitle.cgi?isbn=1118311809. The code is <strong>in</strong> the Chapter 12 download.<br />

Be<strong>in</strong>g able to use a database <strong>in</strong> your <strong>ASP</strong>.<strong>NET</strong> websites is just as critical as underst<strong>and</strong><strong>in</strong>g<br />

HTML <strong>and</strong> CSS: it’s almost impossible to build a modern, full-featured website without it.<br />

Databases are useful because they enable you to store <strong>and</strong> retrieve data <strong>in</strong> a structured way. The<br />

biggest benefit of databases is that you can access them at run time <strong>in</strong> your site, which means<br />

you are no longer limited to just the relatively static files you create at design time <strong>in</strong> Visual<br />

Studio. You can use a database to store reviews, musical genres, pictures, <strong>in</strong>formation about<br />

users (usernames, e-mail addresses, passwords, <strong>and</strong> so on), log <strong>in</strong>formation about who reads<br />

your reviews, news articles, <strong>and</strong> much more, <strong>and</strong> then access that data from your <strong>ASP</strong>X pages.<br />

This gives you great flexibility <strong>in</strong> the data you present, <strong>and</strong> the way you present it, enabl<strong>in</strong>g<br />

you to create highly dynamic websites that can adapt to your visitors’ preferences, to the content<br />

your site has to offer, or even to the roles or access rights that your users have.<br />

To successfully work with a database <strong>in</strong> an <strong>ASP</strong>X page, this chapter teaches you how to access<br />

databases us<strong>in</strong>g a query language called SQL—or Structured Query Language. This language

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

Saved successfully!

Ooh no, something went wrong!