Karthikeyan ThangaRaju
About
class Student { public int Id; public string Name; } static DataTable GetDataTable(Student[] students) { DataTable table = new DataTable(); table.Columns.Add("Id", typeof(Int32)); table.Columns.Add("Name", typeof(string)); foreach (Student student in students) { table.Rows.Add(student.Id, student.Name); } return (table); } The OutputDataTableHeader Method static void OutputDataTableHeader(DataTable dt, int columnWidth) { string format = string.Format("{0}0,-{1}{2}", "{", columnWidth, "}"); // Display the column headings. foreach(DataColumn column in dt.Columns) { Console.Write(format, column.ColumnName); } Console.WriteLine(); foreach(DataColumn column in dt.Columns) { for(int i = 0; i { Console.Write("="); } } Console.WriteLine(); } --------------------- Distinct The Distinct Prototype public static IEnumerable Distinct ( this IEnumerable source, IEqualityComparer comparer); Student[] students = { new Student { Id = 1, Name = "Joe Rattz" }, new Student { Id = 6, Name = "Ulyses Hutchens" }, new Student { Id = 19, Name = "Bob Tanko" }, new Student { Id = 45, Name = "Erin Doutensal" }, new Student { Id = 1, Name = "Joe Rattz" }, new Student { Id = 12, Name = "Bob Mapplethorpe" }, new Student { Id = 17, Name = "Anthony Adams" }, new Student { Id = 32, Name = "Dignan Stephens" }<