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 !!
String Append in LINQ
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.

Diptimaya PatraRank #113 · 19.8K reputationPosted Feb 23, 2010, 4:58 PM EST
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;