I got XML like this:
<Type>
<Connections>
<Conn ServerName="serv1" DataBase="Persons" User="admin" Pass="123"/>
<Conn ServerName="serv2" DataBase="Type123" User="admin" Pass="123"/>
</Connections>
<UDLFiles />
</Type>
so I load the xml like this
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.Load(path);
and I have given a combination of ServerName, DataBase, User and Pass.
How to check in the XML if I have already added this combination as a <Conn> (those are 4 attributes) and how to add it if I havent added it yet?
Another option (if you are using .Net 3.5 or higher) is to skip XmlDocument and use LINQ to XML which, in my opinion, results in cleaner code: