I’m using Microsoft Dynamics CRM 4.0 SDK for my project. When I play with CrmService.Retrieve Method and apply a example from the SDK, it stopped me at:
// Create the column set object that indicates the properties to be retrieved. ColumnSet cols = new ColumnSet(); // Set the properties of the column set. cols.Attributes = new string [] {"fullname"}; |
And raised an error message like this:
Error 1 Property or indexer 'Microsoft.Crm.Sdk.Query.ColumnSet.Attributes' cannot be assigned to -- it is read only C:\Users\user\Documents\Visual Studio 2008\WebSites\WebSite2\Default.aspx.cs 27 9 C:\...\WebSite2\ |
I’m not quite sure what the problem was but I need to replace that with following code:
ColumnSet cols = new ColumnSet(new string[] { "fullname" }); |
Or use AllColumns to retrieve all attributes:
AllColumns ac = new AllColumns(); |
I worked for me, hope it also work for you 🙂