Write small Program to generate Xml Document from table like (StudentRecord Table) using linq query

Write small Program to generate Xml Document from table like (StudentRecord Table) using linq query.

Public void CreateXmlDocFromArray()
{
 // Now enumerate over the array to build an XElement.
 XElement StudentRecords =
 new XElement("StudentInfo",
 from c in Student
 select new XElement("Student",
 new XAttribute("Name", c.Name),
 new XElement("RollNo", c.RollNo)));
Console.WriteLine(StudentRecords);
}
What is Quantifiers in reference linq to Dataset?
Quantifier Operators return the Boolean value (either True or false) if some or all the elements in a sequence satisfy a condition.
Linq interview questions for experienced
Linq interview questions for experienced - What is PLINQ?, Which are the rules apply to a variable scope in lambda expressions?, What is the difference between the Select clause and SelectMany() method in LINQ?, What are the different implementations of LINQ?......
LINQ to SQL questions and answers
Linq to sql interview questions - What is the DataContext class and how is it related to LINQ?, How does LINQ to SQL differ from Entity framework?, How to Update data in LINQ to SQL? Give example.....
Post your comment