Click here to Skip to main content
15,891,184 members
Home / Discussions / C#
   

C#

 
QuestionDifferent ways to persist/share temporary data across classes in a multi-tier WinForm Application? Pin
DaMagicMaster5-Feb-05 20:07
DaMagicMaster5-Feb-05 20:07 
AnswerRe: Different ways to persist/share temporary data across classes in a multi-tier WinForm Application? Pin
Heath Stewart6-Feb-05 6:42
protectorHeath Stewart6-Feb-05 6:42 
AnswerRe: Different ways to persist/share temporary data across classes in a multi-tier WinForm Application? Pin
DaMagicMaster6-Feb-05 16:39
DaMagicMaster6-Feb-05 16:39 
GeneralRe: Different ways to persist/share temporary data across classes in a multi-tier WinForm Application? Pin
Heath Stewart7-Feb-05 6:35
protectorHeath Stewart7-Feb-05 6:35 
GeneralRe: Different ways to persist/share temporary data across classes in a multi-tier WinForm Application? Pin
DaMagicMaster7-Feb-05 12:50
DaMagicMaster7-Feb-05 12:50 
GeneralRe: Different ways to persist/share temporary data across classes in a multi-tier WinForm Application? Pin
Heath Stewart7-Feb-05 15:39
protectorHeath Stewart7-Feb-05 15:39 
GeneralDelete XmlNode Pin
John L. DeVito5-Feb-05 19:31
professionalJohn L. DeVito5-Feb-05 19:31 
GeneralRe: Delete XmlNode Pin
Stefan Troschuetz5-Feb-05 21:07
Stefan Troschuetz5-Feb-05 21:07 
Although I don't know what the "issue" is, you're talking about, and this makes helping a bit hard, I think you're right with the foreach loop as cause.
MSDN clearly states that "the foreach statement is used to iterate through the collection to get the desired information, but should not be used to change the contents of the collection to avoid unpredictable side effects."

As your code removes nodes from ChildNodes collection, that's probably the problem. So switch to a for loop and the problem should be gone:
XmlNode n;
for (int i = 0; i < parentNode.ChildNodes.Count; i++)
{
  n = parentNode.ChildNodes.Item(i);
  if(n.InnerText == programCategoryComboBoxEdit.SelectedItem.ToString())// InnerText already a string
  {
    parentNode = n.ParentNode;
    parentNode.RemoveChild(n);
  }
}
configDoc.Save("katalog.config");//Think it would be more efficient to save document only once after the loop








www.troschuetz.de
GeneralRe: Delete XmlNode Pin
Heath Stewart6-Feb-05 6:33
protectorHeath Stewart6-Feb-05 6:33 
GeneralRe: Delete XmlNode Pin
John L. DeVito8-Feb-05 12:01
professionalJohn L. DeVito8-Feb-05 12:01 
Questionhow to make what SelectionIndent does in tabs Pin
ektoras5-Feb-05 13:46
ektoras5-Feb-05 13:46 
AnswerRe: how to make what SelectionIndent does in tabs Pin
Heath Stewart6-Feb-05 6:29
protectorHeath Stewart6-Feb-05 6:29 
GeneralRe: how to make what SelectionIndent does in tabs Pin
ektoras14-Feb-05 0:59
ektoras14-Feb-05 0:59 
GeneralDifferent font colors in textbox Pin
MG00c2x5-Feb-05 11:47
MG00c2x5-Feb-05 11:47 
GeneralRe: Different font colors in textbox Pin
mav.northwind6-Feb-05 3:56
mav.northwind6-Feb-05 3:56 
GeneralRe: Different font colors in textbox Pin
sugunet7-Feb-05 1:38
sugunet7-Feb-05 1:38 
Generalnew line in string Pin
Majid Shahabfar5-Feb-05 10:29
Majid Shahabfar5-Feb-05 10:29 
GeneralRe: new line in string Pin
Beringer5-Feb-05 11:58
Beringer5-Feb-05 11:58 
GeneralRe: new line in string Pin
MG00c2x5-Feb-05 12:03
MG00c2x5-Feb-05 12:03 
GeneralRe: new line in string Pin
S. Senthil Kumar5-Feb-05 16:06
S. Senthil Kumar5-Feb-05 16:06 
GeneralRe: new line in string Pin
Majid Shahabfar6-Feb-05 6:07
Majid Shahabfar6-Feb-05 6:07 
GeneralRe: new line in string Pin
Jon Sagara5-Feb-05 18:52
Jon Sagara5-Feb-05 18:52 
GeneralRe: new line in string Pin
sugunet6-Feb-05 0:55
sugunet6-Feb-05 0:55 
GeneralRe: new line in string Pin
Majid Shahabfar6-Feb-05 6:05
Majid Shahabfar6-Feb-05 6:05 
GeneralRe: new line in string Pin
mav.northwind6-Feb-05 3:17
mav.northwind6-Feb-05 3:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.