Using Connection string Retrieve the service in MSCRM in C#
//// Required dll/////
Microsoft.CSharp
Microsoft.Crm.Sdk.Proxy
Microsoft.IdentityModel.Clients.ActiveDirectory
Microsoft.Xrm.Sdk
Microsoft.Xrm.Tooling.Connector
Microsoft.Xrm.Tooling.CrmConnectControl
Microsoft.Xrm.Tooling.CrmConnector.Powershell
System
System.Core
System.Data
System.Data.DataSetExtensions
Sysytem.Runtime.Serialization
System.Security
System.ServiceModel
Sysytem.Web.Services
System.Xml
System.Xml.Linq
//////Name spaces////
using System;
using Microsoft.Xrm.Sdk;
using Microsoft.Xrm.Sdk.Messages;
using Microsoft.Xrm.Sdk.Query;
using Microsoft.Xrm.Tooling.Connector;
///using connection string Retrieve the service in MSCRM in C#
var connString = "AuthType=Office365;Username=test@test.onmicrosoft.com; Password=pass@word1;Url=https://test.crm4.dynamics.com";
Microsoft.Xrm.Tooling.Connector.CrmServiceClient conn = new CrmServiceClient(connString);
// Cast the proxy client to the IOrganizationService interface.
var service = (IOrganizationService)conn.OrganizationWebProxyClient != null ? (IOrganizationService)conn.OrganizationWebProxyClient : (IOrganizationService)conn.OrganizationServiceProxy;
Microsoft.CSharp
Microsoft.Crm.Sdk.Proxy
Microsoft.IdentityModel.Clients.ActiveDirectory
Microsoft.Xrm.Sdk
Microsoft.Xrm.Tooling.Connector
Microsoft.Xrm.Tooling.CrmConnectControl
Microsoft.Xrm.Tooling.CrmConnector.Powershell
System
System.Core
System.Data
System.Data.DataSetExtensions
Sysytem.Runtime.Serialization
System.Security
System.ServiceModel
Sysytem.Web.Services
System.Xml
System.Xml.Linq
//////Name spaces////
using System;
using Microsoft.Xrm.Sdk;
using Microsoft.Xrm.Sdk.Messages;
using Microsoft.Xrm.Sdk.Query;
using Microsoft.Xrm.Tooling.Connector;
///using connection string Retrieve the service in MSCRM in C#
var connString = "AuthType=Office365;Username=test@test.onmicrosoft.com; Password=pass@word1;Url=https://test.crm4.dynamics.com";
Microsoft.Xrm.Tooling.Connector.CrmServiceClient conn = new CrmServiceClient(connString);
// Cast the proxy client to the IOrganizationService interface.
var service = (IOrganizationService)conn.OrganizationWebProxyClient != null ? (IOrganizationService)conn.OrganizationWebProxyClient : (IOrganizationService)conn.OrganizationServiceProxy;
Comments
Post a Comment