日期:2014-05-16  浏览次数:20739 次

XML节点的读取

<root>
  <child>
    <key>DataTime</key>
    <value>2014-03-25 08:00:00</value>
    <key>CityName</key>
    <value>北京</value>
    <key>Sstation</key>
    <value>万寿西宫</value>
    <key>AQI</key>
    <value>270</value>
    <key>PM25</key>
    <value>220</value>
    <key>PM10</key>
    <value>263</value>
    <key>SO2</key>
    <value>46</value>
    <key>NO2</key>
    <value>111</value>
    <key>O31</key>
    <value>18</value>
    <key>CO</key>
    <value>2.000</value>
    <key>MaxPoll</key>
    <value>细颗粒物(PM2.5)</value>
    <key>LevelIndex</key>
    <value>重度污染</value>
    <key>Lon</key>
    <value>116.35</value>
    <key>Lat</key>
    <value>39.88</value>
  </child>
<root>


这是XML结构。。没有序列化就是循环读取值。。我现在只要获取所有Value里的值。绑定到

 SqlParameter[] sp ={
                                    new SqlParameter("@MONITORTIME",),
                                    new SqlParameter("@Station",item.),
                                    new SqlParameter("@CityName",),
                                    new SqlParameter("@AQI",),
                                    new SqlParameter("@PM25",),
                                    new SqlParameter("@PM10",),
                                    new SqlParameter("@SO2",),