hi,
Could any one please suggest a solution for the below scenario in LINQ.
string str = ",employeeName"; // suppose that employee name is a column in employee table.
var q = from e in employee
select new { e.EmployeeID, str};
in that str place I need to get my column name, in other words I need to select columns based on the value in str.
Thanks in advance !!
Loading
Diptimaya PatraPosted Feb 23, 2010, 9:58 PM
string str = "di"; //Assume you have some number of rows with Firstname starts with "di"
var result = from e in employeeList
where e.FirstName.StartsWith(str)
select e.FirstName;