zoukankan      html  css  js  c++  java
  • 属性索引访问代码实例

     1 using System.Data
     2 print( " OK le  " )
     3
     4 loadLib( " C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.Data.dll " )
     5 a = new  DataTable()
     6 c1  = new  DataColumn( " c1 " )
     7 a.Columns.Add(c1)
     8
     9 c2  = new  DataColumn( " c2 " )
    10 a.Columns.Add(c2)
    11
    12 c3  = new  DataColumn( " c3 " )
    13 a.Columns.Add(c3)
    14 print(a.GetType())
    15 b = a.NewRow()
    16 b[ 0 ] = " ni hao  "
    17 b[ 1 ] = " you hao  "
    18 b[ 2 ] = " hello world "
    19 print( "  o kle  " )
    20 c = a.Rows
    21 print(b)
    22 print(b[ 0 ])
    23 print(b[ 1 ])
    24 print(b[ 2 ])
    25  
    26 c.Add(b)
    27 print(c.Count)
    28 function  PrintTable(table)
    29 {
    30  
    31 print( " 表一共有 " + a.Rows.Count + " " )
    32      for (i = 0 ;i < a.Rows.Count;i = i + 1 )
    33     {
    34     print(a.Rows[i])
    35          for (j = 0 ;j < a.Columns.Count;j = j + 1 )
    36          {
    37      
    38         print( " " + i + " , " + j)
    39  
    40                 print(a.Rows[i][j])
    41         }

    42
    43    }

    44
    45  
    46 }

    47 PrintTable(a)
  • 相关阅读:
    弗尤博客(二)
    弗尤博客(一)
    第一系列完
    C# 关闭子窗体释放子窗体对象问题
    C#设置IE代理
    C# 计算位置居中
    C# 绘图
    From传值
    pictureBox绑定Base64字符串
    C# 绘制圆角矩形
  • 原文地址:https://www.cnblogs.com/FlyFire/p/355949.html
Copyright © 2011-2022 走看看