title: Read a connection string from a XML file
body: <p>I've read about all I could get on how to read from an XML file, but I can't get anything done. I want to read a connectionstring from an XML file, plain and simple, nothing more. </p>
  
  <p>My XML looks like</p>
  
  <pre><code>&lt;?xml version="1.0" standalone="yes"?&gt;
  &lt;connectionString&gt;  
      &lt;conn&gt;"adsf"&lt;/conn&gt;
  &lt;/connectionString&gt;
  </code></pre>
  
  <p>And I've tried varios way with </p>
  
  <pre><code>XmlDocument doc = new XmlDocument();
  XmlTextReader reader = new XmlTextReader(xmlLoc);
  
  while (reader.MoveToNextAttribute())
  {
      XmlNode a = doc.ReadNode(reader);
      textBox1.Text = Text + a.Name;
  }
  
  XmlDocument xml = new XmlDocument();
  xml.LoadXml(xmlLoc); //myXmlString is the xml file in string //copying xml to string: string myXmlString = xmldoc.OuterXml.ToString();
  XmlNodeList xnList = xml.SelectNodes("/connectionString");
  
  foreach (XmlNode xn in xnList)
  {
      XmlNode example = xn.SelectSingleNode("conn");
  
      if (example != null)
      {
          string na = example["Name"].InnerText;
          string no = example["NO"].InnerText;
      }
  }
  </code></pre>
  
  <p>I'm missing something and I'm not sure what, this should be a very simple task, but I can't get it done. Any help?</p>
  
  <p>I'm trying to do it in a WIndows form application program.</p>