title: Updating Components using the Core Service in SDL Tridion 2011
body: <p>I am updating a Component using Core Service in Tridion 2011.</p>
  
  <p>The sample code is as follows,</p>
  
  <pre><code>string COMPONENT_URI = "tcm:8-674";
  string SCHEMA_URI = "tcm:8-426-8";
  
  ComponentData component = client.TryCheckOut(COMPONENT_URI, null) as ComponentData;
  
  try
  {
      Response.Write("&lt;BR&gt;" + component.Content);
      XDocument xdoc = XDocument.Parse(component.Content);
      var element = xdoc.Elements("first").Single();
      element.Value = "updated";
      xdoc.Save(component.Content);
      client.Save(component, null);
      Response.Write("&lt;BR"+"SAVED");
  }
  catch (Exception ex)
  {
      Response.Write("Unable to save comp" + ex.Message);
  }
  
  client.CheckIn(COMPONENT_URI, null);
  </code></pre>
  
  <p>I am getting following exception:</p>
  
  <pre><code> Unable to save compSequence contains no elements 
  </code></pre>
  
  <p>Details:</p>
  
  <p><code>first</code> - name of the field in the component</p>
  
  <p>Can any one help regarding this?</p>
  
  <p>Thank you</p>