Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Your XPATH value is incorrect. </p> <pre><code>XmlNode myNode = root.SelectSingleNode("/connectionString"); </code></pre> <p>In the line above <code>myNode</code> is null because method <code>SelectSingleNode</code> <strong>returns</strong> The first XmlNode that matches the XPath query or <strong>null if no matching node is found</strong> and there is no node that contains that XPATH. Looks like a typo where you left off the "s" in ConnectionStrings (or think that you can use an attribute name like an element [node] name</p> <p>In your second example the XPATH needs to resolve to</p> <pre><code>"/ConnectionStrings/add[@connectionString='asdf']" </code></pre> <p>Again, it looks like you have a typo where you are using quotes(") instead of ticks(') in your expression.</p> <p>If you are looking for the attributes of the add <code>element</code> then your XPATH expression would be <code>/ConnectionStrings/add</code> and then you can get the attributes of that node. This assumes that you have given us the XML from the root node. You may want to look at this <a href="http://www.w3schools.com/xpath/xpath_syntax.asp" rel="nofollow">tutorial</a></p> <p>You have another typo once you get past the null issue of the <code>XmlNode</code>.</p> <pre><code>node.Attributes["ConnectionStrings"].Value = sql_Connection; </code></pre> <p>in the XML example above the attribute name is <code>connectionString</code> not <code>ConnectionStrings</code> so you will need to change the above line to.</p> <pre><code>node.Attributes["connectionString"].Value = sql_Connection; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload