|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;
namespace jQueryFiveAjaxCalls.StudentRecordArchive
{
public class StudentRecords : DataTable
{
public StudentRecords(int NoOfRecordsToRetrieve): base()
{
Columns.Add("ID", System.Type.GetType("System.Int32"));
Columns.Add("Name", System.Type.GetType("System.String"));
Columns.Add("Score", System.Type.GetType("System.Int32"));
Columns.Add("Comment", System.Type.GetType("System.String"));
Columns.Add("Evaluation Time", System.Type.GetType("System.DateTime"));
Random rd = new Random();
for (int Idex = 1; Idex <= NoOfRecordsToRetrieve; Idex++)
{
string Name = "Student Name No." + Idex.ToString();
int Score = System.Convert.ToInt16(60 + rd.NextDouble() * 40);
string Comment = "Comment on " + Name + " is extremely bad";
if (Score < 80)
{
Comment = "Comment on " + Name + " is very good by the teacher";
}
DataRow row = Rows.Add();
row["ID"] = Idex;
row["Name"] = Name;
row["Score"] = Score;
row["Comment"] = Comment;
row["Evaluation Time"] = System.DateTime.Now;
}
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
I have been working in the IT industry for some time. It is still exciting and I am still learning. I am a happy and honest person, and I want to be your friend.