Linq databinding issue....data doesnt show up in gridview ...I get the message that number and name field are not found in the data source
- by Chandan Khatwani
List<Emp> employees = new List<Emp>();
Emp e1 = new Emp();
e1.number = 2;
e1.name = "Dinesh";
employees.Add(e1);
Emp e2 = new Emp();
e2.number = 3;
e2.name = "Vishal";
employees.Add(e2);
var query = from n in employees
orderby n.name descending
select n;
GridView1.DataSource = query;
GridView1.DataBind();