ApiExamples.ExMailMergeEvent.GetStudentCourseDataTable C# (CSharp) Method

GetStudentCourseDataTable() private static method

Create DataTable and fill it with data. In real life this DataTable should be filled from a database.
private static GetStudentCourseDataTable ( ) : DataTable
return System.Data.DataTable
        private static DataTable GetStudentCourseDataTable()
        {
            DataTable dataTable = new DataTable("StudentCourse");
            dataTable.Columns.Add("CourseName");
            for (int i = 0; i < 10; i++)
            {
                DataRow datarow = dataTable.NewRow();
                dataTable.Rows.Add(datarow);
                datarow[0] = "Course " + i.ToString();
            }
            return dataTable;
        }
        //ExEnd