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)
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)