我正在将数据从 xml 文件导入 c# 中的 datagridview 问题是数据网格视图中只显示一行,即它被覆盖。我的代码如下
DataSet ds = new DataSet();
DataTable dt = new DataTable();
for (int i = 0; i <= 3; i++)
{
ds.ReadXml(@"C:\Users\dell\Downloads\ChillerReport.xml");
dataGridView1.DataSource= ds.Tables[i].DefaultView;
}
我的xml代码如下
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="file:///C:\TechView\XSL\Techview AshraeReport.xsl"?>
<TraneChillerServiceReport label="ASHRAE Chiller Report">
<date label="Date">Wednesday, April 17, 2013 4:15:48 PM IST</date>
<technician label="Technician">sss</technician>
<job_name label="Job Name">01 17 04 13</job_name>
<chiller_name label="Chiller Name">trane</chiller_name>
<reference_number label="Ref Number">01</reference_number>
<location label="Location">ppmf</location>
</chiller_setpoints>
</TraneChillerServiceReport>
请帮忙