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)

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.