Setting up a sample database
In this chapter, we will be demonstrating the difference between how different collection interfaces handle data, and for the demonstrations, you require access to database data. To do so, you will create a database, add a table, and populate it with data. You will use SQL Server for your database engine, and use SQL Server Management Studio to develop your sample database.
Note
In the CH07_LinqPerformance.Data
source code folder, you will find a database creation script called SampleData.Product.sql
that creates the database and populates it with data. You can run this script in SQL Server Management Studio. This will save you from having to run through setting up the database in this section. But if you are new to SQL Server, you may want to run through this section.
To add your database, follow these steps:
- Open SQL Server Management Studio and connect to your database engine.
- Right-click on the Databases folder in Object Explorer...