Appendix A. Database, connection, and data model setup

 

This chapter covers

  • Setting up a data connection
  • Creating an entity data model

In several examples in this book, including those in reporting (see chapter 19), MVVM (see chapter 16), and WCF RIA Services (see chapter 17), we need to work against database data and an entity data model. For this you’ll need SQL Server with the AdventureWorks database loaded.

In this appendix, we’ll install the database, and create the database connection and the entity data model. The entity data model will be added to the ASP.NET web project in your Silverlight solution.

A.1. Install the AdventureWorks database

If your database installation doesn’t already contain the AdventureWorks database, visit http://msftdbprodsamples.codeplex.com/ to download the latest version for your database version.

The CodePlex database sample site includes a number of database releases for the various editions of SQL Server, currently up to SQL Server 2008 R2. My own dedicated database server is running SQL Server 2008, and I have a local SQL Server Express 2008 database instance that came with Visual Studio 2010. The sample databases will install on either one.

A.1.1. Installing on a dedicated SQL Server instance

A.2. Database connection and entities