Running Queries in Visual Studio
If you’ve never used SQL before, you may want to play around with it and create some sample queries before you start using it in an ASP.NET site. Most database products provide some sort of tool for testing queries. If you’re using a full version of SQL Server, you can try SQL Server Management Studio or SQL Query Analyzer. If you don’t want to use an extra tool, you can run your queries using the Server Explorer window described earlier. Just follow these steps in Visual Studio:
1. Right-click your connection, and choose New Query.
2. Choose the table (or tables) you want to use in your query from the Add Table dialog box (as shown in Figure 15-5), click Add, and then click Close.
3. You’ll now see a handy query-building window. You can create your query by adding check marks next to the fields you want, or you can edit the SQL by hand in the lower portion of the window. Best of all, if you edit the SQL directly, you can type in anything—you don’t need to stick to the tables you selected in step 2, and you don’t need to restrict yourself to Select statements.
4. When you’re ready to run the query, select Query Designer ä Execute SQL from the menu. Assuming your query doesn’t have any errors, you’ll get one of two results. If you’re selecting records, the results will appear at the bottom of the window . If you’re deleting or updating records, a message box will appear informing you how many records were affected.
Browsing and Modifying Databases in Visual Studio
As an ASP.NET developer, you may have the responsibility of creating the database required for a web application. Alternatively, it may already exist, or it may be the responsibility of a dedicated database administrator. If you’re using a full version of SQL Server, you’ll probably use a graphical tool such as SQL Server Management Studio to create and manage your databases.
If you don’t have a suitable tool for managing your database, or you don’t want to leave the comfort of Visual Studio, you can perform many of the same tasks using Visual Studio’s
Server Explorer window.
Here’s how you can get started. First, choose View äServer Explorer from the Visual Studio menu to show the Server Explorer window. Then, using the Data Connections node in the
Server Explorer, you can connect to existing databases or create new ones. Assuming you’ve installed the pubs database (see the readme.txt file for instructions), you can create a connection to it by following these steps:
1. Right-click the Data Connections node, and choose Add Connection. If the Choose
Data Source window appears, select Microsoft SQL Server and then click Continue.
2. If you’re using a full version of SQL Server, enter localhost as your server name. This indicates the database server is the default instance on the local computer. (Replace this with the name of a remote computer if needed.) If you’re using SQL Server Express, you’ll need to use the server name localhost\SQLEXPRESS instead, as shown in
Figure 15-2. The SQLEXPRESS part indicates that you’re connecting to a named instance of SQL Server. By default, this is the way that SQL Server Express configures itself when you first install it.
3. Click Test Connection to verify that this is the location of your database. If you haven’t installed a database product yet, this step will fail. Otherwise, you’ll know that your database server is installed and running.
4. In the Select or Enter a Database Name list, choose the pubs database. (In order for this to work, the pubs database must already be installed. You can install it using the database script that’s included with the sample code, as explained in the following section.)
If you want to see more than one database in Visual Studio, you’ll need to add more than one data connection.
Product Overview of VSTS 2010
The marketplace has begun to mature and accept Application Lifecycle Management (ALM) as a proven discipline for creating high-quality applications. However, existing solutions in the marketplace have not kept pace with the changing needs of technical users and the expanding inclusion of non-technical users as part of the lifecycle.
Every customer today faces a similar set of business problems:
• How do we build high quality applications that deliver
real business value?
• How do we embrace the Application Lifecycle Management model effectively?
• How can we ensure that all members of the team – both
technical and non-technical – are part of the process?
• How can we get the most value from our existing code assets?
• How do we make powerful modeling tools available to
everyone in the application lifecycle?
The third generation of Visual Studio Team System – Visual Studio Team System 2010 – will be a robust and streamlined solution that addresses these needs and concerns.
We are evolving Application Lifecycle Management by:
Building quality into the lifecycle
• Ensuring architectural consistency through the lifecycle
• Eliminating “No-Repro” bugs
• Ensuring smooth build handoffs and high quality builds
• Incorporating performance in the lifecycle
Driving efficiency into the test effort
• QA Team aligned with Business Analysts,
Architects, and Developers
• Eliminating tedious tasks
• Improving setup and deployment of tests
• Choosing the right tests
Ensuring Complete Testing
• Focused test planning and progress tracking
• Transparently see the quality of requirements and level of testing
• Finding the gaps in testing and fill them
• Ensuring changes are properly tested