DataTable table = new DataTable(); table.Columns.Add("ID", typeof(int)); table.Columns.Add("Name", typeof(string)); table.Columns.Add("Age", typeof(int)); table.Rows.Add(1, "John Doe", 30); table.Rows.Add(2, "Jane Smith", 25);
dataGridView1.DataSource = table;
var result = from r in table.AsEnumerable() where r.FieldIn this query, we use the AsEnumerable() method to get a collection of DataRow objects, and then use the Field("Age") >= 30 select r;