DataTable dtEmployees = new DataTable(); //Columns of data table dtEmployees.Columns.Add("Name", typeof(string)); dtEmployees.Columns.Add("Salary", typeof(double)); //Adding some rows in the data table dtEmployees.Rows.Add("John", 50000); dtEmployees.Rows.Add("Joseph",25000); dtEmployees.Rows.Add("Jai", 15000);
var result = from row in dtEmployees.AsEnumerable() where row.Field("Salary") > 20000 select row.Field("Name");
foreach (string name in result) { Console.Write(name); }