316649 How to: Use Visual Studio .NET Server Explorer (from mkba)

xiaoxiao2021-03-06  73

This task content

summary

Require Visual Studio .NET Server Explorer

Open and View Server Explorer Add Data Connection Add Server Drag and Water Connection Verification Connection Effective Troubleshooting Reference

SUMMARY This article explains how to use the server resource manager in Visual Studio .NET.

Back to top

The following table summarizes the recommended hardware, software, network structure, and the required service pack:

Visual Studio .NET This article assumes that you are familiar with the following topics:

Visual Studio .NET Microsoft Visual Basic .NET or Microsoft Visual C # .NET

Back to top

Visual Studio .NET Server Explorer Server Explorer is a new development tool in Visual Studio .NET that can be shared between development language and projects. Using Server Explorer, you can connect to the server and view and access the server. For example, you can connect to, view, and access the following resources:

Database Connection Server Crystal Report Event Log Message Queuing Performance Counter Windows Service

Back to top

Open and view server resource manager

Start Visual Studio .NET. Use Visual Basic .NET or Visual C # .NET to create a new Windows application. On the View menu, click Server Explorer. The Server Explorer window uses the tree view to display the server resources, which includes the following top nodes:

The data connection server clicks to expand the data connection node. This node lists data connections to the database server currently available. You can create a connection to Microsoft SQL Server running on Microsoft Windows, or create a connection to the Oracle database running on UNIX. Data connection may not appear in this node based on your computer configuration. Click to expand the top-level server node. This node lists the currently available servers. Each server node lists databases and server resources that can be used in applications.

Back to top

Add data connection

In the Server Explorer window, right-click the data connection node and click Add Connection. In the combo box in the Data Link Properties dialog box, type or select a server name. For example, if the SQL server is installed on the local machine, type LOCAL. Type login information according to your environment needs. Select the database you want to use. For example, if a connection pointing to a SQL server, you can click Northwind. Click the test connection to verify the data connection is valid. After a few seconds, the following message is displayed:

Test Connection Succeededed

If an error is encountered during this test, check the settings and make any changes needed. Click OK. Note that the new data connection is displayed as a child node under the data connection node. Click to expand the data connection node you just created. Note that the Server Explorer shows the tables, views, and stored procedures you can get from this server.

Back to top

Add server

In the Server Explorer window, right-click the server node and click Add Server. In the Add Server dialog box, type different server names that are different from your local server, or type an IP address that is different from your Internet Protocol (IP) address. If you log in to the server using other usernames, click "Connect Using A Different User Name" and then type your username and password. Click OK. Note that the new server node is displayed under the top server node. Click to expand the server node just created. The Server Explorer will display resources for you, such as Crystal Service, Event Logs, Message Queues, Performance Counters, Services, and SQL Server. When you click to expand your local server name, you receive the same information about the local computer. Back to top

Drag the connection from the Server Explorer to your form You can use the drag and drop method to copy almost all objects from the Server Explorer to the Visual Studio .NET designer. Integrated Development Environment (IDE) automatically creates pre-configured objects, you can use this object in your application.

Object replication features provide a powerful tool for "Fast Application Development" (RAD) programming. For example, when you drag a data connection to a form, Visual Studio .NET creates a connection object that does not require you to provide any code.

To use a drag and drop method to create a new connection, perform the following steps:

In the Server Explorer window, select the data connections you create, then switch to the Form Designer. Direction data connection from the server resource manager on FORM1. Visual Studio .NET automatically creates a SQLConnection object that has been set up for Connectionstring, Database, and DataSource properties. Now you can run your code and use

SqlConnection.

Back to top

After verifying if the connection is effectively added, there will be a new node displayed in top

Data connection node below. You should be able to browse the server table, the view, and stored procedures.

After adding the server, there will be a new node displayed in top

The server node is below. You should be able to browse the server to view its resources, such as event logs, messages, and performance counters.

After dragging and dropping the data connection to FORM1, a name is

SqlConnection1 (in Visual Basic .NET) or

SqlConnection1 (in Visual C # .NET)

SqlConnection objects are displayed

In the list of components.

Back to top

Troubleshooting This article uses a system-specific setting. You must use the server name, database name, login name, and password suitable for your system.

Back to top

Refer to more information, please refer to the following MSDN Web site:

Server's fast application develop http://msdn.microsoft.com/vstudio/nextgen/technology/radserver.asp unified IDE to maximize developer's work efficiency http://msdn.microsoft.com/vstudio/ Nextgen / Technology / Productivity.asp Access management data in Server Explorer http://msdn.microsoft.com/library/default.asp?url=/library/EN-US/WMISE/WMioriManagementDataNode.asp

Back to top

The information in this article applies to:

Microsoft Visual Studio .NET (2002), Professional Edition

转载请注明原文地址:https://www.9cbs.com/read-108906.html

New Post(0)