PDA

Click to See Complete Forum and Search --> : Select


martialdc
Jan 19th, 2003, 08:27 PM
I add a Button and put this code;
Dim aFind As String = InputBox("Enter a Employee No.", "Search for Employee No.")
Dim filteredRows() As DataRow = DataSet11.Employee.Select("empno='" & aFind & "'")

But it has no reaction. The DataGrid still show all the records.
What's wrong with this?

chinhow
Jan 19th, 2003, 11:09 PM
You have to add a clear statement first.
DataSet11.clear() 'Clear the dataset's data

and use the sql statement filter it out and fill it into the dataset

Athley
Jan 20th, 2003, 01:27 AM
If you set the datasource of the datagrid to a DataView instead you can use the DataView.RowFilter property to filter your data.