I want to retrieve records in a DataGridView using a DataView. For example, I want to retrieve records of students whose age is between 15 to 18. How do I do that? Below is my code for retrieving a single record only using a DataView:
dgvReport.DataSource = new DataView(dt, "StudentID = " + txtSearch.Text, "StudentID", DataViewRowState.CurrentRows);
Any help would be appreciated. Thank you.
you can use RowFilter Property for this
you will get rows with age begining from 15 and ending with 18