Click here to Skip to main content
16,016,537 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have one XML file.

XML
<tasks>
  <task>
    <id>1</id>
    <name>Raj</name>
    <age>23</age>
  </task>
  <task>
     <id>2</id>
     <name>25</name>
     <age>27</age>
  </task>
</tasks>

and have one class:

public class student
{
public int id{get;set;}
public string Name{get;set;}
public int age {get; set;}
}

I want to read from xml file and assign to this student class as list using c#.
please help me
Posted
Updated 6-Oct-15 1:39am
v2

1 solution

you could always start by a search here on CP and then posting actual code you've tried rather than asking to be spoon fed (we dont spoon feed or do homework)

have a look here to get started XML Serialization and Deserialization: Part-2[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900