Re: LINQ and XML for compact framework

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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
.



Relevant Pages

  • Re: LINQ and XML for compact framework
    ... Hang on - you said before that it wasn't getting inside the foreach ... You said that "msgs" was empty - which means it wouldn't be ... After it executed that, or during the execution? ... see whether it really does have a MessageStaus element. ...
    (microsoft.public.dotnet.languages.csharp)
  • tcsh foreach terminates early & at random.
    ... I've tried to make use of a dual core machine by running a few jobs ... I added 'set verbose' before the foreach and found that the last line of the ... shell script to be executed is usually the "endif" (followed by the ... execution of the command where it gets put into the background. ...
    (comp.unix.shell)
  • Re: Uninitialized value in pattern match
    ... I suggest using a command like, just before the foreach loop (for testing ... which might be empty or the entire list might be empty. ... foreach $PkgFile(@$PkgList) ...
    (perl.beginners)
  • Re: How to recursively delete a directory in .NET that contains files
    ... directory is not empty. ... method further providing for deletions with files... ... foreach (string fichero in ficheros) File.Delete; ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: empty displayed data except "space" and "newline"
    ... For identifying whether it's an 'empty displayed' value, ... foreach my $k_tmp{ ... Or you could push*and* clear out the array at the same time: ... and $k_tmp contains space characters at the beginning like " some ...
    (perl.beginners)