Private Function GetSampleData() As DataSet
Dim theDataSet As New DataSet()
Dim projectKey As String = "projectKey"
Dim theProjects As DataTable = theDataSet.Tables.Add("Projects")
theProjects.Columns.Add("ProjectID")
theProjects.Columns.Add("ProjectKey")
theProjects.Columns.Add("ProjectName")
theProjects.Columns.Add("ProjectStartTime", GetType(DateTime))
' Assign values for each Project member
theProjects.Rows.Add(New [Object]() {Guid.NewGuid(), projectKey, "QuarterlyProject", DateTime.Today})
Dim theTasks As DataTable = theDataSet.Tables.Add("Tasks")
theTasks.Columns.Add("TaskID")
theTasks.Columns.Add("ProjectKey")
theTasks.Columns.Add("TaskName")
theTasks.Columns.Add("TaskStartTime", GetType(DateTime))
theTasks.Columns.Add("TaskDuration", GetType(TimeSpan))
theTasks.Columns.Add("ParentTaskID")
theTasks.Columns.Add("Constraint", typeof(object))
theTasks.Columns.Add("TaskPercentComplete")
'The Task properties are all covered by individual members. But we could save space in the database
'By storing data as binary using AllProperties and not binding the other fields.
theTasks.Columns.Add("AllProperties", typeof(Byte[]))
' Parent Task1
Dim planningTaskid As Guid = Guid.NewGuid()
' Assign values for each Task member
theTasks.Rows.Add(New [Object]() {planningTaskid, projectKey, "Planning", DateTime.Now, TimeSpan.FromDays(5), Nothing, TaskConstraint.StartNoEarlierThan, Nothing})
' Child Task1 of Parent Task1
theTasks.Rows.Add(New [Object]() {Guid.NewGuid(), projectKey, "Prepare Budget", DateTime.Now, TimeSpan.FromDays(2), planningTaskid,TaskConstraint.StartNoEarlierThan,100})
' Child Task2 of Parent Task1
theTasks.Rows.Add(New [Object]() {Guid.NewGuid(), projectKey, "Allocate Teams", DateTime.Now.AddDays(2), TimeSpan.FromDays(3), planningTaskid, TaskConstraint.StartNoEarlierThan, Nothing})
' Parent Task2
Dim implementationTaskid As Guid = Guid.NewGuid()
theTasks.Rows.Add(New [Object]() {implementationTaskid, projectKey, "Implementation", DateTime.Now.AddDays(6), TimeSpan.FromDays(16), Nothing, TaskConstraint.StartNoEarlierThan, Nothing})
Dim installationTaskid2 As Guid = Guid.NewGuid()
' Child Task1 of Parent Task2
theTasks.Rows.Add(New [Object]() {installationTaskid2, projectKey, "Installations", DateTime.Now.AddDays(6), TimeSpan.FromDays(2), implementationTaskid, TaskConstraint.StartNoEarlierThan, 60})
' Child Task2 of Parent Task2
theTasks.Rows.Add(New [Object]() {Guid.NewGuid(), projectKey, "Execution", DateTime.Now.AddDays(8), TimeSpan.FromDays(13), implementationTaskid, TaskConstraint.StartNoEarlierThan, Nothing})
' Parent Task3
Dim testingTaskid As Guid = Guid.NewGuid()
theTasks.Rows.Add(New [Object]() {testingTaskid, projectKey, "Testing", DateTime.Now.AddDays(23), TimeSpan.FromDays(20), Nothing, TaskConstraint.StartNoEarlierThan, Nothing})
' Child Task1 of Parent Task3
theTasks.Rows.Add(New [Object]() {Guid.NewGuid(), projectKey, "TestPhase1", DateTime.Now.AddDays(23), TimeSpan.FromDays(10), testingTaskid, TaskConstraint.StartNoEarlierThan,
20})
' Child Task2 of Parent Task3
theTasks.Rows.Add(New [Object]() {Guid.NewGuid(), projectKey, "TestPhase2", DateTime.Now.AddDays(36), TimeSpan.FromDays(9), testingTaskid, TaskConstraint.StartNoEarlierThan,
Nothing})
Return theDataSet
End Function