• 记忆深刻的一段简单代码


    这段代码一直记着,他是我研究DataSet,DataTable,XML的开始

                DataSet dataSet = new DataSet("dataSet");
                DataTable table = dataSet.Tables.Add("Items");
                table.Columns.Add("id", typeof(int));
                table.Columns.Add("Item", typeof(string));

                DataRow row;
                for (int i = 0; i < 3; i++)
                {
                    row = table.NewRow();
                    row["id"] = i;
                    row["Item"] = "Item" + i;
                    table.Rows.Add(row);
                }

                Console.WriteLine(dataSet.GetXml());

    结果:<dataSet>
                  
    <Items>
                        <id>0<id>
                        <Item>Item0</Item>
                   <Items>
                   <Items>
                        <id>1<id>
                        <Item>Item1</Item>
                   <Items>
                   <Items>
                        <id>2<id>
                        <Item>Item2</Item>
                   <Items>

             
    <dataSet>

  • 相关阅读:
    关于jquery
    3D转换(位置)+过渡+透视
    浅谈相对定位与绝对定位
    多层菜单
    菜单栏
    轮播图
    jsp中表格序号递增,varStatus="vs"
    关于数据库的增删改查
    put请求(单整体改),patch请求(群单改,群改)
    ModelSerializer 序列化和反序列化,及序列化整合,单删/增,群删/增(delete请求)
  • 原文地址:https://www.cnblogs.com/winvay/p/1346012.html
Copyright © 2020-2023  润新知