| |
 |
WCF Data Services
The Data Source Configuration Wizard allows you to bind the PivotGridControl to data using WCF Data Services. This topic guides you through the steps needed to do this.
-
Click the Data Source Wizard button placed on the PivotGridControl or use a corresponding command in a control's smart tag.

-
In the invoked Data Source Configuration Wizard, select WCF Data Services...

... and click the New Data Source button placed within the Data Sources area.

-
The following message will appear.

Click OK.
-
Specify the address of a data service.

To learn how to create a WCF data service, see the following topics: Creating the Data Service.
Important
After you creat a service reference, rebuild the solution.
-
After creating a service reference, click the Data Source Wizard again.

-
In the invoked Data Source Configuration Wizard, select the created service.

Click Next.
-
On the next page, select the required binding method.

Select Direct Binding to Data Source and click Next.
-
On the final page, specify the service URI (Service Root) and click the Test Connection button.

Then, select the required Table and click Finish.
-
The following code will be generated by the Data Source Configuration Wizard.
C# |
public Form1()
{
InitializeComponent();
pivotGridControl1.DataSource = new WinFormsPivot.ServiceReference1.NorthwindEntities(new System.Uri("http://localhost:65455/Northwind.svc/")).SalesPersons.ToList();
}
|
VB |
Public Class Form1
Sub New()
InitializeComponent()
PivotGridControl1.DataSource = New WinFormsPivot.ServiceReference1.NorthwindEntities(New System.Uri("http://localhost:65455/Northwind.svc/")).SalesPersons.ToList()
End Sub
End Class
|
You can now work with the created data source at runtime. For instance, to retrieve fields from the connected data source, call the PivotGridControl.RetrieveFields method.
Is this topic helpful?
Additional Feedback
Close
|