How to: Connect to Data in a Service

 

For the latest documentation on Visual Studio 2017, see How to: Connect to Data in a Service on docs.microsoft.com. You connect your application to the data returned from a service by running the Data Source Configuration Wizard and selecting Service on the Choose a Data Source Type page.

Upon completion of the wizard, a service reference is added to your project and is immediately available in the Data Sources Window.

System_CAPS_ICON_note.jpg Note

The items that appear in the Data Sources window are dependent on the information that the service returns. Some services might not provide enough information for the Data Source Configuration Wizard to create bindable objects. For example, if the service returns an untyped dataset, then no items appear in the Data Sources Window upon completing the wizard. This is because untyped datasets do not provide schema, so the wizard does not have enough information to create the data source.

System_CAPS_ICON_note.jpg Note

Your computer might show different names or locations for some of the Visual Studio user interface elements in the following instructions. The Visual Studio edition that you have and the settings that you use determine these elements. For more information, see Personalizing the IDE.

To connect your application to a service

  1. On the Data menu, click Add New Data Source.

  2. Select Service on the Choose a Data Source Type page, and then click Next.

  3. Enter the address of the service you want to use, or click Discover to locate services in the current solution, and then click Go.

  4. Optionally, a new Namespace can be typed in place of the default value.

    System_CAPS_ICON_note.jpg Note

    Click Advanced to open the Configure Service Reference Dialog Box.

  5. Click OK to add a service reference to your project.

  6. Click Finish.

    The data source is added to the Data Sources window.

To add functionality to your application

Bind WPF controls to a WCF data service
Windows Communication Foundation Services and WCF Data Services in Visual Studio

Show: