Database Setup

Each lab will have its own instructions for installing specific database scripts, or for configuring connection strings. In this section, I’ll review some general guidelines for database setup, script installation, and connection string formats.

Choosing a Database Engine

You have to make a decision about the database engine to use for samples that rely on a database or that use ASP.NET membership and roles. Your choice of database engine affects how you configure connection strings for labs and samples.

Your options are as follows:

  • Microsoft SQL Server 2000 or 2005

  • Microsoft SQL Server 2005 Express Edition (SQL Express)

If you don’t have access to SQL Server 2000 or 2005, you can download SQL Express from the following location: http://msdn.microsoft.com/vstudio/express/sql/download/.

Installing Database Scripts

To install database scripts for book labs and samples, you’ll need a management tool. If you installed SQL Server 2000 or 2005, you can use SQL Server Management Studio to administer any database. Otherwise, you can install SQL Server Management Studio Express from here: http://msdn.microsoft.com/vstudio/express/sql/download/.

To install a database script, open the database management tool, and then open and run the .sql script.

Database Connection Strings

Labs and samples in this book that rely on a database will require a connection string setting in the application or web configuration file.

The following illustrates a connection string for a SQL 2000 or 2005 installation ...

Get Learning WCF now with O’Reilly online learning.

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