SUMMARY
This article discusses five key productivity features in
Microsoft Visual Studio 2005 and in Microsoft Visual Studio .NET:
- Server Explorer
- Dynamic Help
- Enhanced Task List
- Enhanced Toolbox
- Enhanced IntelliSense
Other important productivity features, including Automation,
Visual Database Tools, and the greatly improved debugger, are discussed in
other Microsoft Knowledge Base "How To" articles.
Requirements
The
following list outlines the recommended hardware, software, network
infrastructure, and service packs that you need:
- Visual Studio 2005 or Visual Studio .NET
This
article assumes that you are familiar with the following topics:
- Visual Studio 2005 or Visual Studio .NET
- Microsoft Visual Basic 2005 or Microsoft Visual Basic
.NET
Using the key productivity features in Visual Studio 2005 and in Visual Studio .NET
Note All the subheadings in this section assume that you have started
Visual Studio 2005 or Visual Studio .NET.
- To start Visual Studio 2005, click Start,
point to Programs, point to Microsoft Visual Studio
2005, and then click Microsoft Visual Studio
2005.
- To start Visual Studio .NET, click Start,
point to Programs, point to Microsoft Visual Studio
.NET, and then click Microsoft Visual Studio
.NET.
Server Explorer
Server Explorer is a server management console that you can use
to view and to manipulate data links, database connections, and system
resources on any server to which you have network access.
Server
Explorer includes two primary nodes:
- Data Connections. This node contains connections that the user added to specific
databases.
- Servers. The Computer_Name node in this node
contains various server resource and database nodes, including the following:
- Crystal Services
- Event Logs
- Message Queues
- Performance Counters
- Services
- SQL Servers
To use Server Explorer, follow these steps:
- Press CTRL+ALT+S to open Server Explorer.
- Right-click the Data Connections node, and
then click Add Connection.
- In the Data Link Properties dialog box,
follow these steps:
- In the Select or enter a server name
box, type or select the name of your localhost server.
- Under Enter information to log on to the
server, either click Use Windows NT Integrated
security, or type a user name and password.
- In the Select a database on the server
list, select a database on your server.
- Click OK. Notice that the new
connection appears under the Data Connections node. If you do
not see your new connection, make sure that you expand the Data
Connections node.
- Click the node for your new connection.
Notice
that you can access all of the objects that appear in SQL Server Enterprise
Manager. You can expand any of these nodes and double-click the database
objects that are contained in the nodes to view and to edit the object, similar
to SQL Server Enterprise Manager.
Note You do not have to specify a data connection in localhost
connections because one already exists under the SQL Servers
node (which appears under the Servers node). When you click
the SQL Servers and the
SQL_Server_instance_name nodes, notice that the
Northwind connection already exists. Therefore, you typically use the
Data Connections node for direct connections to a database
that you would not have access to in your server network. - To close Server Explorer, click the Close
button in the upper-right corner of the console.
Alternately, you can
click the Auto Hide button to hide Server Explorer and to keep
Server Explorer running. You can move your pointer over the Server
Explorer tab at the edge of the integrated development environment
(IDE) to view the Server Explorer console temporarily. You can also click the
Auto Hide button again so that the Server Explorer console
window is visible permanently.
Dynamic Help
The "Dynamic Help Window" documentation from the Visual Studio
2005 and Visual Studio .NET product documentation describes the functionality
of Dynamic Help as follows:
This window provides pointers to information specific to the current area you are using or task you are trying to complete in the integrated development environment (IDE)... The Dynamic Help window displays information that fits into the following categories, among others: Help, Actions, Miscellaneous, Training, Getting Started, and Samples. Links in these categories are displayed according to weighted relevance.
To view this documentation, visit the following Microsoft
Developer Network (MSDN) Web site:
To use Dynamic Help, follow these steps:
- Click
Dynamic Help on the Help menu
to open the Dynamic Help window.
- On the Tools menu, click
Options.
- In the Options dialog box, make sure that
the Environment node is expanded.
- Click Dynamic Help under the
Environment node to customize how the Dynamic Help window
appears, and then click OK.
If you use Visual Studio 2005, you can find the Dynamic Help
window in the Help subnode under
Environment.
- Press CTRL+ALT+S to open Server Explorer if it is not
already open.
- In Server Explorer, click the Data
Connections node, and simultaneously watch the Dynamic Help window.
Notice that the links change, particularly in the Help category.
- In Server Explorer, click the Servers
node, and simultaneously watch the Dynamic Help window. Notice that a new set
of relevant links appears in the Dynamic Help window.
The Dynamic Help window makes pertinent support information
immediately available. You can even add custom links to your own Help content
so that these links appear in the Dynamic Help window. For more information
about how to add custom links to the Dynamic Help window, see the "
References" section.
Note The context-sensitive help that is available from the F1 key is
still an important tool to use for support information. F1 is often the best
way to find the answer that you need. For example, if you select an error
message in the Task List, you can generally obtain specific information to help
you resolve the problem by pressing F1.
Task List
The Task List maintains the features of the Task List from
earlier versions of Microsoft Visual Studio, such as the ability to view build
errors and the ability to view coding errors that the precompiler detects. You
can double-click an IntelliSense message and move the insertion point to the
specified location in the code.
Additionally, Visual Studio 2005 and
Visual Studio .NET add new functionality to the Task List. You can now mark
your code with specialized comments that are parsed and displayed in a tabular
format in the Task List.
To use the Task List, follow these steps:
- On the View menu, point to Show
Tasks, and then click All. Notice you can also select
more specific Task View categories also.
- Follow these steps to create a new project:
- Visual Studio 2005
- On the File menu, point to
New, and then click Web Site.
- In the New Web Site dialog box,
click ASP.NET Web Site under Visual Studio installed
templates.
- In the Language list, verify that
Visual Basic is selected, and then click
OK.
- Visual Studio .NET
- On the File menu, point to
New, and then click Project.
- In the New Project dialog box,
click Visual Basic Project under Project
Types, and then click ASP.NET Web Application under
Templates. Click OK.
- When WebForm1.aspx appears, double-click anywhere on the
Web Form to move to the Page_Load event handler.
Note In Visual Studio 2005, the file name is Default.aspx instead of
WebForm1.aspx. - Add the following code to the handler.
' TODO: A task
- Press ENTER. Notice that your task appears in the Task List
window.
- Double-click the task to move to the commented line of
code.
Other built-in keywords include "HACK" and "UNDONE". You can
also add custom keywords. To add custom keywords, follow these steps:
- On the Tools menu, click
Options.
- In the Options dialog box, click the
Environment node, and then click Task List.
Notice that the list of built-in keywords appears in the Token
list box.
- In the Name text box under Comment
Tokens, type COOL, and then click
Add. Notice that COOL is added to the list of keywords in the
Token list box.
- Click OK.
- Add the following code to the Page_Load event handler.
' COOL: Tell my friends.
Notice that your task appears in the Task List window.
Toolbox
The Toolbox in Visual Studio 2005 and in Visual Studio .NET is
very similar to the Toolbox in earlier versions of Visual Studio. However, the
Toolbox in Visual Studio .NET includes Web-based and Windows-based form
controls, ActiveX controls, XML Web services, Hypertext Markup Language (HTML)
elements, objects, and items from the Clipboard. Moreover, you can now create
custom items that you can easily reuse by dragging code or objects from the
Code window to the Toolbox.
To use the Toolbox, follow these steps:
- Use the ASP.NET Web application project that you created in
the "Task List" section.
- Press CTRL+ALT+X to open the Toolbox. Notice that the
Toolbox contains various tool groups.
- Press F7 to switch to Code view, and then click the
WebForm1.aspx tab. Notice the Toolbox adjusts to the context
and displays tool groups that relate to Web Forms design.
You can also add a custom tool group to the Toolbox. To add a
custom tool group, follow these steps:
- Right-click in the Toolbox, and then click Add
Tab.
- Type MyGroup, and then press
ENTER.
- Expand the Web Forms group.
- Drag a DataGrid control from the Toolbox onto the Web Form designer.
The instance of the DataGrid control is automatically
named DataGrid1.
If you use Visual Studio 2005, you can drag a DataView control instead.
- Customize the properties of the DataGrid control
that you created in step 4.
- Drag
the DataGrid1 control
from the Web
Form designer to
the MyGroup tab in the Toolbox. Notice that a new item named
Markup Fragment is added to your custom tab.
- Right-click Markup Fragment. The shortcut
menu includes various options, including Rename. You can now
reuse this code fragment as you would any of the other items in the
Toolbox.
Note You can use source code instead of visual objects to perform the
same procedure.
IntelliSense
Visual Studio 2005 and Visual Studio .NET enhance the
IntelliSense feature from previous versions of Visual Studio.
To use
IntelliSense, follow these steps:
- Use the ASP.NET Web application project that you created in
the "Task List" section.
- In the Code window, click the
WebForm1.aspx.vb tab.
- In the Page_Load event handler, type Me.
after the commented code.
Notice that the IntelliSense drop-down list
of options appears, which contains all of the properties, methods, and events
that are related to the class in which you are positioned. - Use the DOWN ARROW key to browse through the options in the
IntelliSense drop-down list. You can pause on each option to review the
associated ToolTip.
- Press the ESC key to hide the drop-down list, and then press
CTRL+J .
Notice that the drop-down list appears immediately with the
same list of options.
- Select IsPostBack from the list, and then
press the TAB key. Notice that the complete word appears.
- Press ENTER to move to a new line, and then type
isp. Notice that nothing occurs.
Although you
do not need the Me keyword, IntelliSense does not assume that you are trying to type
IsPostBack until you invoke the Complete Word feature by pressing CTRL+J. - Add the following code.
If IsPostBack Then
End If
Move your pointer over the IsPostBack property until
the ToolTip appears. This feature is called Quick Info. To immediately access
this feature, position your cursor over
the keyword in question, press CTRL+K, and then press
CTRL+I. - Type Me.FindControl( in the If...Then statement.
Notice that, as you type the opening
parenthesis, IntelliSense displays the complete declaration for the function in
a pop-up window.
Additionally, notice that the first parameter in the
list appears bold. For overloaded functions, the Parameters
list allows you to select the function that you want to use. Press the UP ARROW
or the DOWN ARROW to move between functions.
Note When you type function parameters, the bold formatting changes to
reflect the next parameter that you must type.