zoukankan      html  css  js  c++  java
  • DataTable表的遍历

    1、        

        for (int i = 0; i < dt.Rows.Count; i++)
                {
                    for (int j = 0; j < dt.Columns.Count; j++)
                    {
                        sb.Append(dt.Rows[i][j] + "   ");
                    }
                    sb.AppendLine();
                }

    2、
                foreach (DataRow row in dt.Rows)
                {
                    foreach (DataColumn c in dt.Columns)
                    {
                        sb.Append(row[c.ColumnName] + "   ");
                    }
                    sb.AppendLine();
                }

    3、
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    for (int j = 0; j < dt.Rows[i].ItemArray.Length; j++)
                    {
                        sb.Append(dt.Rows[i][j] + "   ");
                    }
                }

  • 相关阅读:
    12
    11
    10
    9
    8
    6. iOS APP 设计规范大全
    4. iOS中常用演示方法以及利弊
    我要写一篇动态计算tableView-cell高度的随笔
    doclever 5.5.1 安装及升级【原创】
    SPARROW-JS 从0开始写 0依赖,原生JS框架
  • 原文地址:https://www.cnblogs.com/pengJk/p/6347371.html
Copyright © 2011-2022 走看看