0

Hello i have a small question,

<?xml version="1.0"?>
<mysql-connect>
     <db id="0" select="1">
	<username>root</username>
	<password>1q2w3e</password>
	<database>OT</database>
	<hostname>localhost</hostname>
     </db>
     <db id="1" select="0">
	<username>testuser</username>
	<password>woos</password>
	<database>notadb</database>
	<hostname>whereamg</hostname>
     </db>
     <db id="2" select="0">
	<username>testuser2</username>
	<password>woos2</password>
	<database>notadb2</database>
	<hostname>whereamg2</hostname>
     </db>
</mysql-connect>

and i have 1 dropdown box and 3 textfields

How can i add these values to the first drop box and with the selected one fill out the rest of the fields? (btw the XML file is still adjustable)

1
Contributor
1
Reply
2
Views
9 Years
Discussion Span
Last Post by njitram
0

Im now testing in a Console:

XmlTextReader reader = new XmlTextReader("c:\\test.xml");
            while (reader.Read())
            {
                if (reader.Name.CompareTo("username") == 0 || reader.Value != "")
                {
                    switch (reader.NodeType)
                    {
                        case XmlNodeType.Element: // The node is an element.
                            Console.Write("<" + reader.Name);
                            Console.WriteLine(">");
                            break;
                        case XmlNodeType.Text: //Display the text in each element.
                            Console.WriteLine(reader.Value);
                            break;
                        case XmlNodeType.EndElement: //Display the end of the element.
                            Console.Write("</" + reader.Name);
                            Console.WriteLine(">");
                            break;
                    }
                }
            }
            Console.ReadLine();

But if i want to read something specific, im sure how to can some one explain? Thanks

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.