Chapter 7: Working with Data

183

Figure 7-1 Server Explorer

View Server Explorer or pressing CTRL-ALT-S. Server Explorer, shown in Figure 7-1, allows you to work with databases, servers, and SharePoint. Servers give you access to the various types of services for managing an operating system, such as Event Logs, Performance Counters, and Services. It is very convenient to be able to access these services in VS during development. For example, if you need to restart an operating system service, you can do it quickly. SharePoint is out of the scope of this book, but the relevant part of Server Explorer is the Data Connections section at the top, which you can see in Figure 7-1.

The Data Connections section will have a list of databases that you can select and work with. Initially, the list will be empty and you must add connections yourself, which you can do by right-clicking Data Connections and configuring the database settings. Since the process of connecting to an existing database is similar to the task for creating a database, I’ll show you how to create a brand new database instead, which is covered in the next section.

Creating a Database

All of the examples in this chapter will use a database that we will create in this section. Therefore, we need to create a database to work with. With VS Standard and higher, you don’t need external tools to create a simple database because there is built-in support for getting started. That said, there are advanced scenarios where a database administrator would want to use the SQL Server tools to create the database themselves, meaning that you would only want to connect to the database they created. For many cases, you can just create the database yourself to get started.

Page 206
Image 206
Microsoft 9GD00001 manual Creating a Database, 183