我从 Web 请求中获取了这种格式的 xml,但我无法在 wpf 中将它绑定到数据中。
这是我的 xml:
<population>
<name>Tram, Joshua </name>
<id>83804</id>
<hcp>Dr. Krueger</hcp>
<symptoms>4</symptoms>
<range>1/17/13 - 4/13/13</range>
<last7>5</last7>
<connect>41380</connect>
<engage>5</engage>
<daysin>160</daysin>
<education>0.67</education>
<recco>Encourage Education</recco>
<name>Riess, Chuck </name>
<id>73403</id>
<hcp>Dr. Vockell</hcp>
<symptoms>4</symptoms>
<range>2/1/13 - 2/14/13</range>
<last7>5</last7>
<connect>41332</connect>
<engage>5</engage>
<daysin>179</daysin>
<education>0.74</education>
<recco>Encourage Tracking</recco>
<name>Park, Teruyuki </name>
<id>69235</id>
<hcp>Dr. Smithen</hcp>
<symptoms>3</symptoms>
<range>4/3/13 - 4/13/13</range>
<last7>5</last7>
<connect>41384</connect>
<engage>5</engage>
<daysin>35</daysin>
<education>0.15</education>
<recco> </recco>
</population>
这是我的代码,我将它存储在数据集中并与数据网格绑定,但它只显示在列上而不是全部。
WebRequest request = HttpWebRequest.Create(url);
WebResponse response = request.GetResponse();
DataSet set = new DataSet();
set.ReadXml(response.GetResponseStream());
return set;