1
我得到這種格式的xml從網絡請求的響應,但我無法綁定它惠普數據滴在wpf。WPF綁定數據網格與xml在web響應中返回
這裏是我的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>
這裏是我的代碼,我將它存儲在數據集中,並與DataGrid的約束力,但只顯示在列不是全部。
WebRequest request = HttpWebRequest.Create(url);
WebResponse response = request.GetResponse();
DataSet set = new DataSet();
set.ReadXml(response.GetResponseStream());
return set;
的XML似乎奇怪的是,至少可以說..無論如何,你有什麼嘗試?您詢問關於綁定到WPF數據網格,但您提供的代碼不顯示任何WPF相關行...... – RoelF 2013-05-02 14:42:30
它看起來像是從XML中缺少標籤。每個標籤有多個實例(即,,等),就好像它們應該用另一個標籤包裝一樣。 –
Murkaeus
2013-05-02 17:13:22
沒有它的實際xml由webrequest – 2013-05-03 05:36:43