but the problem is:
in order to bring "jone" I use : xmlReader.ReadElementString()
but if I now want to bring Name I can't use xmlReader.Name becuase it gives me the next Elemnt - LastName..
How can I read an <...> if I already read the string Element?

Kirtan PatelRank #292 · 8.6K reputationPosted Dec 31, 2009, 8:15 AM EST
Here is your solution !!
friend, if my answer helps you than check "Do you like this answer" check box :)
static void Main(string[] args)
{
XmlDocument doc = new XmlDocument();
doc.Load("XMLFile1.xml");
foreach (XmlNode node in doc.ChildNodes)
{
if (node.Name == "tok")
{
foreach (XmlNode child in node)
{
Console.WriteLine(child.Name);
//If you want value inside the use below line
//Console.WriteLine(child.InnerText);
}
}
}
Console.ReadKey();
}
Output
-----
Lalit MRank #1,186 · 1.5K reputationPosted Dec 31, 2009, 8:19 AM EST
http://www.codeproject.com/KB/XML/csreadxml1.aspx
Happy New Year....
batel hodefi48 reputationPosted Dec 31, 2009, 9:38 AM EST
I don't want foreach loop..I need to read a line take the string and sometime the element and advance to the next line...