Export (0) Print
Expand All

Adding Items from Server Explorer

When you drag certain resources from Server Explorer and drop them onto Visual Studio .NET designers, the integrated development environment (IDE) automatically creates new components that reference the resources selected. For example, if you drag a message queue from Server Explorer onto a Windows project, the IDE automatically creates a MessageQueue component preconfigured to reference that particular queue. You can then write code that accesses and manipulates data from that queue via this new data component.

To create a new data component using Server Explorer

You can create a data component preconfigured to reference a particular resource.

  1. Open the project, form, or class to which you want to add a data component in a designer.
  2. In Server Explorer, select the data item you want to use.
  3. Drag the item from Server Explorer to the designer surface, or right-click the item and select Add to Designer.

The following table lists items that you can drag from Server Explorer, and describes the components created when you drop them onto Visual Studio .NET project, form, or class designers.

Node type Draggable items Result
Data Connections Individual database tables, views, stored procedures, and functions A data connection and dataset command appear in your designer. For more information, see Adding New Data Connections in Server Explorer and Data Access Technologies.
Servers Event log categories, message queues, performance counters,
and services
For more information, see Adding New Servers in Server Explorer and Databases in Server Explorer.
Crystal Reports Individual Crystal Enterprise or Server File reports For more information, see Crystal Reports, Connecting to Crystal Enterprise Reports, and Adding Crystal Enterprise or Server File Reports to the Design View.
Event Logs Event log categories An EventLog component appears, pointing to the category selected. For more information, see Logging Application, Server, and Security Events.
Message Queues Individual message queues A MessageQueue component appears, pointing to the queue selected. For more information, see Creating Messaging Components.
Performance Counters Individual counters and instances A PerformanceCounter component appears, pointing to the counter (and instance) selected. For more information, see Introduction to Monitoring Performance Thresholds.
Services Individual services A ServiceController component appears, preconfigured to interact with the service selected. For more information, see Introduction to Communicating with Existing Services.

You also can create blank data components by dragging items from the Toolbox.

To create a new data component using the Toolbox

  1. Select the desired data component in the Toolbox.
  2. Drag this component onto a project, form, or class.

    A new, blank instance of the component is created.

  3. Configure the properties of this new component in the Properties window or in your programming code.

    For example, you can drag a DataGrid component from the Components tab of the Toolbox to a Windows project, and then configure its properties manually. For more information, see Configuring Data Controls to Use Universal Data Link (.udl) Files.

See Also

User Credentials and Access to Data Sources in Server Explorer | Displaying Data Sources in Server Explorer | Introduction to Data Access with ADO.NET | Recommendations for Data Access Strategies | Web Data Access Strategy Recommendations | Connecting to Remote Resources with Server Explorer | Information on Data Link Properties and OLE DB Providers | Adding New Servers in Server Explorer | Databases in Server Explorer

Show:
© 2014 Microsoft