Ok first to include the wildcard just change the filter text from = to Like and add the * to the end. Then to have it automatically move to the resulting row you can filter the existing dataset instead of returning an array of Datarows as the result:
If later you need or want to remove the filter just assign it a blank string. That will return you to the full dataset of data.VB Code:
Private Sub btnSearch_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSearch.Click 'this assumes textbox1 is where the name is to search for Dim filter As String = String.Format("Name Like '{0}*'", TextBox1.Text) DataSet11.Tables("Bankruptcy").DefaultView.RowFilter = filter End Sub
VB Code:
DataSet11.Tables("Bankruptcy").DefaultView.RowFilter = String.Empty




Reply With Quote