Forums - C# Corner

Forum guidelines
Gaurav Rana

Gaurav Rana

  • 1.3k
  • 191
  • 9.5k

How to populate dataset with list of objects ?

Aug 1 2017 11:21 AM
I do have list of students. How do i create dataSet and populate these object in data set with column name as well?
List<Student> students = new List<Student>()
{
new Student {RollNumber=1, Name = "john", Grade=2, Pass = true },
new Student {RollNumber=2, Name = "Jeana", Grade=2, Pass = true },
new Student {RollNumber=3, Name = "Smith", Grade=2, Pass = false },
new Student {RollNumber=4, Name = "Ron", Grade=2, Pass = true },
new Student {RollNumber=5, Name = "Mark", Grade=2, Pass = false },
new Student {RollNumber=6, Name = "Phillip", Grade=2, Pass = true },
};
}

Answers (1)