I have this code:
XElement EcnAdminConf = new XElement("Type",
new XElement("Connections",
new XElement("Conn"),
// Conn.SetAttributeValue("Server", comboBox1.Text);
// Conn.SetAttributeValue("DataBase", comboBox2.Text))),
new XElement("UDLFiles")));
// Conn.
How do I add attributes to Conn
? I want to add the attributes I marked as comments, but if I try to set the attributes on Conn
after defining EcnAdminConf
, they are not visible.
I want to set them somehow so the XML looks like this:
<Type>
<Connections>
<Conn ServerName="FAXSERVER\SQLEXPRESS" DataBase="SPM_483000" />
<Conn ServerName="FAXSERVER\SQLEXPRESS" DataBase="SPM_483000" />
</Connections>
<UDLFiles />
</Type>