我正在使用变量
创建一个xml文件verificacaoconjunta
这是xml文件的一部分
// <tabelaGERAL>
// <Nome>Verificacao conjunta</Nome>
// <Valor>1</Valor>
// <tabelaGERAL>
它清楚地表明它的价值是1
但是当我在这里阅读表格时:
DataTable lertabela = new DataTable();
lertabela.ReadXml(path);
verificacaoconjunta = lertabela.Rows[4]["valor"].ToString();
令人惊讶地返回0,我创建了一个按钮来检查它在桌子上的价值,结果是
任何可能出错的提示?
编辑: 完整的xml文件
<?xml version="1.0" standalone="yes"?>
<NewDataSet>
<xs:schema id="NewDataSet" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xs:element name="NewDataSet" msdata:IsDataSet="true" msdata:MainDataTable="tabelaGERAL" msdata:UseCurrentLocale="true">
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="tabelaGERAL">
<xs:complexType>
<xs:sequence>
<xs:element name="Nome" type="xs:string" minOccurs="0" />
<xs:element name="Valor" type="xs:string" minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:schema>
<tabelaGERAL>
<Nome>Accao G</Nome>
<Valor>10</Valor>
</tabelaGERAL>
<tabelaGERAL>
<Nome>Accao Q</Nome>
<Valor>15</Valor>
</tabelaGERAL>
<tabelaGERAL>
<Nome>Accao W</Nome>
<Valor>7</Valor>
</tabelaGERAL>
<tabelaGERAL>
<Nome>Tipo de verificacao</Nome>
<Valor>1</Valor>
</tabelaGERAL>
<tabelaGERAL>
<Nome>Verificacao conjunta</Nome>
<Valor>1</Valor>
</tabelaGERAL>