-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
32 lines (29 loc) · 930 Bytes
/
Program.cs
File metadata and controls
32 lines (29 loc) · 930 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
using System;
using System.Diagnostics;
using System.Data;
namespace DataTableMakeSample
{
class Program
{
static void Main(string[] args)
{
DataTable table = DataTableUtils.GetDataTable(typeof(PersonTable));
for (int i = 0; i <= 10; i++)
{
DataRow row = table.NewRow();
row[PersonTableSetting.Name] = "Name " + i;
row[PersonTableSetting.Age] = 20 + i;
table.Rows.Add(row);
}
foreach (DataRow row in table.Rows)
{
Debug.WriteLine("{0}: {1}", PersonTableSetting.Id,
row[PersonTableSetting.Id]);
Debug.WriteLine("{0}: {1}", PersonTableSetting.Name,
row[PersonTableSetting.Name]);
Debug.WriteLine("{0}: {1}", PersonTableSetting.Age,
row[PersonTableSetting.Age]);
}
}
}
}