EDN Admin
Well-known member
I have a document structure like
<workload><br/>
<strName>Power</strName><br/>
<strVersion>9.3.6545</strVersion><br/>
<Voltage>65464</Voltage><br/>
<Interview><br/>
<Rack ><br/>
<Server><br/>
<BLServer Width="SINGLE" Selected="True" /><br/>
<GeneralConfiguration><br/>
<PowerPhase>Single</PowerPhase> <br/>
<PowerRedunduncy>None</PowerRedunduncy><br/>
</GeneralConfiguration><br/>
<ModelDetails><br/>
<PowerSupply><br/>
<Item><br/>
<number>554542HGG</number><br/>
<Supplyname>Pwr Kit</Supplyname><br/>
<Supplytype>PowerSupply</Supplytype><br/>
<quantity>2</quantity><br/>
</Item><br/>
</PowerSupply><br/>
</ModelDetails><br/>
</Server><br/>
</Rack><br/>
</Interview><br/>
</workload>
i have a query for xmlDocument for retriving powerphase
XmlNode xmlNode = xmlDoc.SelectSingleNode("workload/Interview/Rack/Server/GeneralConfiguration");<br/>
if (null != xmlNode.SelectSingleNode("PowerPhase"))<br/>
{<br/>
return xmlNode.SelectSingleNode("PowerPhase").InnerText;<br/>
}
now we are coverting to xdocument and rewriting the querys using LINQ
Iam new to LINQ
Please <a> <a> <a> <a> <a> <a> <a> <a> <a> <a> <a> <a> <a> <a> <a> <a> <a> <a> <a> <a> <a> <a> <a> <a> <a> help me how to retrive PowerPhase value using LINQ Query
for Xdocument.
<br/>
<br/>
<br/>
View the full article
<workload><br/>
<strName>Power</strName><br/>
<strVersion>9.3.6545</strVersion><br/>
<Voltage>65464</Voltage><br/>
<Interview><br/>
<Rack ><br/>
<Server><br/>
<BLServer Width="SINGLE" Selected="True" /><br/>
<GeneralConfiguration><br/>
<PowerPhase>Single</PowerPhase> <br/>
<PowerRedunduncy>None</PowerRedunduncy><br/>
</GeneralConfiguration><br/>
<ModelDetails><br/>
<PowerSupply><br/>
<Item><br/>
<number>554542HGG</number><br/>
<Supplyname>Pwr Kit</Supplyname><br/>
<Supplytype>PowerSupply</Supplytype><br/>
<quantity>2</quantity><br/>
</Item><br/>
</PowerSupply><br/>
</ModelDetails><br/>
</Server><br/>
</Rack><br/>
</Interview><br/>
</workload>
i have a query for xmlDocument for retriving powerphase
XmlNode xmlNode = xmlDoc.SelectSingleNode("workload/Interview/Rack/Server/GeneralConfiguration");<br/>
if (null != xmlNode.SelectSingleNode("PowerPhase"))<br/>
{<br/>
return xmlNode.SelectSingleNode("PowerPhase").InnerText;<br/>
}
now we are coverting to xdocument and rewriting the querys using LINQ
Iam new to LINQ
Please <a> <a> <a> <a> <a> <a> <a> <a> <a> <a> <a> <a> <a> <a> <a> <a> <a> <a> <a> <a> <a> <a> <a> <a> <a> help me how to retrive PowerPhase value using LINQ Query
for Xdocument.
<br/>
<br/>
<br/>
View the full article