albert albert

albert albert

  • NA
  • 524
  • 0

Showing connection string in textfield

Sep 5 2013 5:15 AM
Hi Everybody,

I have a Listbox and a textfield and then if you select from the listbox(ConnectionName) an item then in the textbox the connectionstring has to be shown.

I have this:

[code]
private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            XmlDocument docHallo = new XmlDocument();
            docHallo.Load(@"C:/Users/IllesIuliu/Documents/Visual Studio 2010/Projects/WindowsFormsApplication18/GetSelectedID/XML/Configurations.xml");
            XmlNodeList nodeList = docHallo.GetElementsByTagName("SupplyXMLConnectionString");
            

            //XmlNodeList nodelistConnectionString = docHallo.GetElementsByTagName()
            txtConfigurationName.Text = nodeList.Item(listBox1.SelectedIndex).ToString();



        }
[/code]

But then I get this as output:

System.Xml.XmlElement - in the textbox

THX

Answers (15)