How To retrieve the list of organizations using C#

Open your solution in VS , right-click the name of the project that you want to add the service to, and then click Add Service Reference.

The Add Service Reference dialog box appears

 

add service reference

click Discover.

All WCF services in the current solution are added to the Service list.

In the Service list, expand the node for the service that you want to use and select a service contract.

In the Namespace box, enter the namespace that you want to use for the reference

Click OK to add the reference to the project.

A service client (proxy) is generated, and metadata describing the service is added to the app.config file

Then add the following references assemblies

  1. Microsoft.crm.sdk.proxy
  2. Microsoft.Xrm.Sdk
  3. System.ServiceModel

solution

 

getorg

and this is the result

getOrg

Advertisements