locked
The given dot notation 'ID' refers to a node in Type Descriptor that does not exist RRS feed

  • Question

  • I'm using Silverlight to update an external list and am getting an error at "int id = Convert.ToInt32(myItem["ID"])

    List listName = myweb.Lists.GetByTitle("MyList");
    ListItem myItem = listName.AddItem(new ListItemCreationInformation());
    myItem["Field1"] = "Testing";
    myItem.Update();
    context.ExecuteQueryAsync(((object sender, ClientRequestSucceededEventArgs args) =>
    {
       int id = Convert.ToInt32(myItem["ID"]);
    }
    

    This method works when I try to update a native SharePoint list, but with the external type it's failing. The ID field shows up on the list.  The model includes the following  in the Create method

    <Parameter Direction="Return" Name="Create">
      <TypeDescriptor TypeName="System.Data.IDataReader, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" IsCollection="true" Name="Create">
        <TypeDescriptors>
          <TypeDescriptor TypeName="System.Data.IDataRecord, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" Name="CreateElement">
    	<TypeDescriptors>
    	  <TypeDescriptor TypeName="System.Int32" ReadOnly="true" IdentifierName="ID" Name="ID" />
    	</TypeDescriptors>
          </TypeDescriptor>
        </TypeDescriptors>
      </TypeDescriptor>
    </Parameter>
    

    So as far as I can tell, the ID should be returned. Any thoughts on how to make this work?

    Wednesday, October 26, 2011 3:58 PM

Answers