Connect To Organization Web service in MS CRM 2011

Provide the connection to the server using a connection string. You can find the CrmConnection class in namespace Microsoft.Xrm.Client and dll (Microsoft.Xrm.Client.dll which is avaialbale in sdk/bin folder)

//The following example shows the connection string using Active Directory authentication:

Microsoft.Xrm.Client.CrmConnection connection = CrmConnection.Parse(“Url=http://<Crm Server>/<Orgnization Name>;Domain=<contoso>;Username= Abc;Password=Abc;”);

// Create object of Organization Service

OrganizationService service  = new OrganizationService(connection);

Entity entity = new Entity(“lead”);
entity[“subject”] = “Test”;
entity[“firstname”] = “Arvind”;
entity[“lastname”] = “Singh”;
Guid leadId = service.Create(entity);

For details, please go through below link
http://msdn.microsoft.com/en-in/library/gg695810.aspx

hope it helps..

Author: Arvind Singh

Solution Architect with 15+ years of exp. Dynamics CRM, Power Platform, Azure which includes Solution, Design, Development, Deployment, Maintenance and support experience.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: