Hi Ray,
here you gou:
foreach (XmlNode node in xmlDocumentObj ["configurat ion"]
["appSetting s"].ChildNodes)
{
// you can use 'node' here
}
BUT I would not recommand that type of iteration. You should first set the
XmlNodeList and do the iteration stuff with the new instance:
XmlNode configuration = xmlDocumentObj ["configurat ion"];
XmlNode appSettings = null;
XmlNodeList allSettigns = null;
if (configuration != null)
{
appSettings = configuration ["appSetting s"];
if (appSetrings != null && appSettings.Has ChildNodes)
{
allSettings = appSettings.Chi ldNodes;
foreach (XmlNode node in allSettings)
{
// your code goes here
}
}
}
Hope that helps
Patrick
"Ray5531" wrote:
Sorry here is what I want to convert to C#:
For Each Node In XmlDocument.Ite m("configuratio n").Item("appSe ttings")
"Ray5531" <Ra*****@micros oft.com> wrote in message
news:ON******** *****@TK2MSFTNG P15.phx.gbl... what is the equivalent of this in C# ?
foreach (XmlNode xmlConfigNode in
xmlConfigDoc["configurat ion"].ChildNodes)
Thansk