Note that there are some explanatory texts on larger screens.

plurals
  1. POXML values wont read to string
    primarykey
    data
    text
    <p>I am having difficulties with my XML code it doesn't seem to saving and when I print it out nothing happens. I am not sure what is wrong because before it would load into my listbox but it would load incorrectly. The code is below and the purpose of my XML reading is the store the values in a list and then get a selected tag and add it to a listbox.</p> <pre><code>String workingDir = Directory.GetCurrentDirectory(); XmlTextReader textReader = new XmlTextReader(workingDir + @"\XML.xml"); textReader.Read(); XmlNodeType type; while (textReader.Read()) { textReader.MoveToElement(); type = textReader.NodeType; if (type == XmlNodeType.Text) { if (textReader.Name == "Code") { textReader.Read(); code = textReader.Value; Console.WriteLine(code); } if (textReader.Name == "Name") { textReader.Read(); name = textReader.Value; Console.WriteLine(name); } if (textReader.Name == "Semester") { textReader.Read(); semester = textReader.Value; Console.WriteLine(semester); } if (textReader.Name == "Prerequisite") { textReader.Read(); preReq = textReader.Value; Console.WriteLine(code); } if (textReader.Name == "LectureSlot") { textReader.Read(); lSlot = textReader.Value; Console.WriteLine(lSlot); } if (textReader.Name == "TutorialSlot") { textReader.Read(); tSlot = textReader.Value; Console.WriteLine(tSlot); } if (textReader.Name == "Info") { textReader.Read(); info = textReader.Value; module.Add(new modules(name, code, semester, tSlot, lSlot, info, preReq)); } } foreach (object o in module) { modules m = (modules)o; String hold = m.mName; selectionBox.Items.Add(hold); } } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload