Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7001489
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T20:48:35+00:00 2026-05-27T20:48:35+00:00

I am developing silverlight web part for sharepoint 2010. I have an xml file

  • 0

I am developing silverlight web part for sharepoint 2010. I have an xml file in my application as follows

<sst xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" count="67" uniqueCount="39">
  <si>
    <t>INVOICE</t>
  </si>
  <si>
    <t>INVOICE #</t>
  </si>
  <si>
    <t>Bill To:</t>
  </si>
  <si>
    < t>DESCRIPTION</t>
  </si>
  <si>
    <t>AMOUNT</t>
  </si>
  <si>
    <t>TOTAL</t>
  </si>
  <si>
    <t>FOR:</t>
  </si>
  <si>
    <t>Positive Behavior Support Corp</t>
  </si>
  <si>
    <t>8108 SE Coconut St.</t>
  </si>
  <si>
    <t>Hobe Sound, FL 33455</t>
  </si>
  <si>
    <t>772-349-6317 Phone  772-675-9100 Fax</t>
  </si>
  <si>
    <t>EIN 20-5268843</t>
  </si>
  <si>
    <t>Provider 693068996</t>
  </si>
  <si>
    <t>Rate</t>
  </si>
  <si>
    <t>Units</t>
  </si>
  <si>
    <t>DATE</t>
  </si>
  <si>
    <t>Michael Nolan Ph.D. BCBA</t>
  </si>
  <si>
    <t>____________________________________________</t>
  </si>
  <si>
    <t>BCBA                          Date</t>
  </si>
  <si>
    <t>CLIENT:</t>
  </si>
  <si>
    <t>Date:</t>
  </si>
  <si>
    <t>Behavior Assistant- L. Bresson</t>
  </si>
  <si>
    <t>Email:</t>
  </si>
  <si>
    <t>1 Unit = 1 hour</t>
  </si>
  <si>
    <t>TOTALS</t>
  </si>
  <si>
    <t>cvt1970@juno.com</t>
  </si>
  <si>
    <t>Attn: Cecilia</t>
  </si>
  <si>
    <t>Behavior Assistant- B. Bresson</t>
  </si>
  <si>
    <t>Behaviror Ass't -N Giarratano</t>
  </si>
  <si>
    <t>Signature of Representatives Approval           Date</t>
  </si>
  <si>
    <r>
      <t xml:space="preserve">Behavior Asst- </t>
    </r>
    <r>
      <rPr>
        <sz val="9" />
        <rFont val="Arial" />
        <family val="2" />
      </rPr>
      <t>N Giarratano-</t>
    </r>
    <r>
      <rPr>
        <sz val="10" />
        <rFont val="Arial" />
        <family val="2" />
      </rPr>
      <t>08</t>
    </r>
  </si>
  <si>
    <t>Behavior Asst- B. Bresson-08</t>
  </si>
  <si>
    <t>Behavior Asst- L. Bresson-08</t>
  </si>
  <si>
    <t>&lt;@Invoice&gt;</t>
  </si>
  <si>
    <t>&lt;@For&gt;</t>
  </si>
  <si>
    <t>&lt;@Client&gt;</t>
  </si>
  <si>
    <t>&lt;@Caregiver&gt;</t>
  </si>
  <si>
    <t>&lt;@Email,@Address,@City,@State,@Zip&gt;</t>
  </si>
  <si>
    <t>&lt;@Date&gt;</t>
  </si>
</sst>

I am successfully loading this xml file. Now I am acessing all the element with name “t” from xml file as follows.

XNamespace ns = xmlDoc.Root.Name.Namespace;
            var eles = from c in xmlDoc.Descendants(ns + "si")
                       select c.Element(ns + "t");

It is also working fine.
But when I use the following query it gives me error

eles.Elements(ns + "t").Where(x => x.Element(ns + "t").Value == "&lt;@Date&gt;").SingleOrDefault().SetElementValue(ns + "t","hi");

It gives me error as object reference is not set to instance of object. How I can replace the “<@Date> with “hi” in the existing xml. Can you please provide me any code or link through which I can resolve the above issue ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T20:48:35+00:00Added an answer on May 27, 2026 at 8:48 pm

    Your eles variable is already returning the <t>. None of the <t> have a child that is <t>, so it makes sense that x.Element(ns + "t") doesn’t return anything (thus null, thus .Value is an error). Actually, I’m a bit confused, because eles.Elements(ns + "t") should have been an empty sequence.

    Also, the value in C# terms is <@Date>; the &gt; / &lt; only applies to xml.

    Also, the query is being impacted by the one <si> that doesn’t have a <t>; a better variant would be:

    var eles = xmlDoc.Descendants(ns + "si").Elements(ns + "t");
    

    (which handles 0, 1, or many <t> per <si>)

    Then after that, you mean:

    eles.SingleOrDefault(x => x.Value == "<@Date>").Value = "hi";
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am developing a Silverlight web part for Sharepoint 2010. I have a button
I am developing silverlight web part for sharepoint 2010. In my project I have
I am developing silverlight web part. I have a one List Entry log. In
I'm developing a small web application using Microsoft Silverlight 3. I'm using Microsoft Expressin
At the moment I'm developing a web based application using Silverlight 3.0. For the
I have been developing a Silverlight application using WCF. The problem is that sometimes
I am developing silverlight application. I have a listbox in my application. I am
I'm developing Silverlight OOB application and I need to show web pages in it
I'm developing a web page for a customer using the Silverlight application for dynamic
hi im developing silverlight application but when i m trying to compile that file

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.