Hi....
Below is the table structure with data
DataTable Emp = new DataTable();
Emp.Columns.Add("Id", System.Type.GetType("System.Int32"));
Emp.Columns.Add("Name", System.Type.GetType("System.String"));
Emp.Columns.Add("Deptid", System.Type.GetType("System.Int32"));
Emp.Rows.Add(1, "Vasanth",1);
Emp.Rows.Add(2, "Pradeep",2);
Emp.Rows.Add(3, "Rakesh",3);
Using Lambda expression i need to select Id and name column from the data table. Its not working. Let me know if you find the answer
var result3 = Emp.Select( E => new { empid = E.Id, empname = E.Name });
But it was displaying error.
Error : Cannot convert lambda expression to type 'string' because it is not a delegate type
Please gime me the solution