I am trying to change an existing attribute value of an XML Node that has child nodes. I am getting an exception when trying to do this.
string specificOwnerPath = "Owners/Owner[@id='" + startingOwnerName + startingOwnerZipCode + "']";
XmlNode ownerID = doc.SelectSingleNode(specificOwnerPath);
ownerID.Attributes["id"].Value = ownerNameTextBox.Text + ownerZipCodeTextBox.Text;
The exception I am getting says 'Object reference not set to the instance of an object and is occurring at the final line of code shown above. Does anyone have any suggestions on what I am doing wrong?