If you have some excellent Ideas in C# and you are not able to convert it in to C# then you should go
there-[OnLine Code Converter][
^] to convert C# code to vb.net code. whatever
Try given code in vb.net
Private Sub btnSearch_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSearch.Click
Try
DataGridViewForm.YourBindingSource.Filter = String.Format("{0} = '{1}'", _
DataGridViewForm.YourDataSet.YourTable.Columns(columnIndex).ColumnName.ToString, TextBox1.Text)
Catch
MessageBox.Show("Database error")
End Try
Me.Close()
End Sub