我有这个 xml 文件。我正在尝试获取特定 servername 属性的所有 dbistance。对于每个 dbistance 信息组,我想在列表框中添加这样的连接结果 DEFAULT - DBCATALOG - USERNAME - PASSWORD - 1433 请我...开始讨厌 linq :)
<?xml version="1.0" encoding="utf-8" ?>
<root>
<server servername="SRV01">
<dbistance>
<istancename>DEFAULT</istancename>
<catalog>DBCATALOG01</catalog>
<username>USERNAME</username>
<password>PASSWORD</password>
<port>1433</port>
</dbistance>
<dbistance>
<istancename>DEFAULT</istancename>
<catalog>DBCATALOG02</catalog>
<username>USERNAME</username>
<password>PASSWORD</password>
<port>1433</port>
</dbistance>
</server>
<server servername="SRV02">
<dbistance>
<istancename>DEFAULT</istancename>
<catalog>DBCATALOG01</catalog>
<username>USERNAME</username>
<password>PASSWORD</password>
<port>1433</port>
</dbistance>
</server>
</root>