zoukankan      html  css  js  c++  java
  • xml做ds的数据源

    <?xml version="1.0" encoding="utf-8"?>
    <GoodsInfo>
      <Item>
        <GoodsClass>鲜花绿植</GoodsClass>
        <GoodsName>玫瑰花</GoodsName>
      </Item>
      <Item>
        <GoodsClass>鲜花绿植</GoodsClass>
        <GoodsName>菊花</GoodsName>
      </Item>
      <Item>
        <GoodsClass>鲜花绿植</GoodsClass>
        <GoodsName>月季</GoodsName>
      </Item>
      <Item>
        <GoodsClass>时尚礼品</GoodsClass>
        <GoodsName>金珠耳环</GoodsName>
      </Item>
      <Item>
        <GoodsClass>时尚礼品</GoodsClass>
        <GoodsName>金珠手镯</GoodsName>
      </Item>
      <Item>
        <GoodsClass>时尚礼品</GoodsClass>
        <GoodsName>太碾手表</GoodsName>
      </Item>
      <cl>
        <GoodsClass>chenlu</GoodsClass>
        <GoodsName>xiao</GoodsName>
        <Goodsu>liuliu</Goodsu>
      </cl>
    </GoodsInfo>

    DataSet ds = new DataSet();

    ds.ReadXml(Server.MapPath("~/XMLFile.xml"));
                    this.GridView1.DataSource = ds;
                    this.GridView1.DataBind();

    这样ds加载了2张表

    Item表 字段是GoodsClass,GoodsName

    cl表 字段是GoodsClass,GoodsName,Goodsu

  • 相关阅读:
    UNP学习第八章udp
    UNP学习第七章
    linux IPC 消息队列(二)
    epoll学习(二)
    epoll学习
    UNP学习第六章(二)
    UNP学习第六章select
    UNP学习第五章(二)
    UNP学习第五章
    UNP学习第四章tcp
  • 原文地址:https://www.cnblogs.com/chenlulouis/p/1650911.html
Copyright © 2011-2022 走看看