Use Data Services to Simplify Data Modification in Microsoft Dynamics CRM
[Applies to: Microsoft Dynamics CRM 4.0]
The create, retrieve, update, and delete operations provided in the XrmDataContext class are analogous to the DataServiceContext class of the ADO.NET Data Services framework. The core members of DataServiceContext also exist (following the same signatures) in XrmDataContext. In addition to the ease of portability between server and client applications, this pattern allows better integration with other .NET components that recognize this type of context pattern.
The following examples are based on the following connection string read from an App.config (or Web.config) file:
<connectionStrings> <add name="Crm" connectionString="Authentication Type=Passport; Server=https://your-org-name.crm.dynamics.com/your-orgid; User ID=your-windowslive-id; Password=your-wlid-password; Device ID=your-device-id; Device Password=your-device-password"/> </connectionStrings>
- Create, Update and Delete Operations
- Add or Update Associations between Related Records
- Sample Code for Create, Update and Delete Operations
- Use Dynamic Entity to Create, Update, and Delete Records
- Mixing Strong Types with Dynamic Entity
- Use Dynamic Entity to Add or Update Associations between Related Records
© 2010 Microsoft Corporation. All rights reserved.