Re: LINQ and XML for compact framework
- From: Wan <luowan@xxxxxxxxx>
- Date: Fri, 2 May 2008 03:03:16 -0700 (PDT)
On May 1, 5:41 pm, "Jon Skeet [C# MVP]" <sk...@xxxxxxxxx> wrote:
On May 1, 4:39 pm, Wan <luo...@xxxxxxxxx> wrote:
The exception was thrown inside the foreach statement.
Hang on - you said before that it wasn't getting inside the foreach
statement. You said that "msgs" was empty - which means it wouldn't be
trying to set the value.
Which is it?
After it excute
el.Element("MessageStaus").SetValue(newStatus.ToString());
this line of code, the exception was fired.
After it executed that, or during the execution? My guess is that
el.Element("MessageStaus") is returning null, but you really need to
make sure your diagnostics are consistent before you go any further.
If it *is* going into the foreach loop, work out why you thought it
wasn't.
Then look at "el" (again, with a message box or something similar) to
see whether it really does have a MessageStaus element.
Jon
Hi Jon
Problem is solved. The LINQ statement I wrote was incorrect. Because
in my XML, I have namespace, but I didn't specify it in my XElement.
Thanks very much for your help :-)
Best Regards,
Wan
.
- References:
- Re: LINQ and XML for compact framework
- From: Jon Skeet [C# MVP]
- Re: LINQ and XML for compact framework
- From: Wan
- Re: LINQ and XML for compact framework
- From: Jon Skeet [C# MVP]
- Re: LINQ and XML for compact framework
- From: Wan
- Re: LINQ and XML for compact framework
- From: Jon Skeet [C# MVP]
- Re: LINQ and XML for compact framework
- From: Wan
- Re: LINQ and XML for compact framework
- From: Jon Skeet [C# MVP]
- Re: LINQ and XML for compact framework
- From: Wan
- Re: LINQ and XML for compact framework
- From: Jon Skeet [C# MVP]
- Re: LINQ and XML for compact framework
- From: Wan
- Re: LINQ and XML for compact framework
- From: Jon Skeet [C# MVP]
- Re: LINQ and XML for compact framework
- Prev by Date: Re: Best RTF/HTML Editor for Winforms.
- Next by Date: Re: Retrieving form data from an asp page
- Previous by thread: Re: LINQ and XML for compact framework
- Next by thread: Re: LINQ and XML for compact framework
- Index(es):
Relevant Pages
|