'データテーブルを初期化します
Public ReadOnly Property Employees() As DataTable
Get
If _employees Is Nothing Then
_employees = New DataTable("従業員")
_employees.Columns.Add("ID", System.Type.[GetType]("System.String"))
_employees.Columns.Add("名", System.Type.[GetType]("System.String"))
_employees.Columns.Add("姓", System.Type.[GetType]("System.String"))
_employees.Columns.Add("国", System.Type.[GetType]("System.String"))
_employees.Columns.Add("生年月日", System.Type.[GetType]("System.DateTime"))
For row As Integer = 0 To 9
Dim dRow As DataRow = _employees.NewRow()
dRow("ID") = _rnd.[Next](100000, 999999).ToString()
dRow("名") = _firstNames(_rnd.[Next](_firstNames.Length))
dRow("姓") = _lastNames(_rnd.[Next](_lastNames.Length))
dRow("国") = _countries(_rnd.[Next](_countries.Length))
dRow("生年月日") =
DateTime.Today.AddDays(-_rnd.[Next](1, 365))
_employees.Rows.Add(dRow)
Next
End If
Return _employees
End Get
End Property