Test Filter for results and handle error is 0 records

Ryan Lashway 61 Reputation points
2022-05-11T20:50:58.97+00:00

I am running a filter on a binding source with the following code. I am getting an error is the search value has no record and can not resolve it:

CustomerBindingSource.Filter = String.Format("Firstname Like '{0}%' or lastname like '{0}%' or CustCode Like'{0}%'", searchValue)

The filter works, but as soon as you type "oienceoicvnwevoiwn" it errors due to no record being found and the bindingsource = 0

VB
VB
An object-oriented programming language developed by Microsoft that is implemented on the .NET Framework. Previously known as Visual Basic .NET.
2,564 questions
{count} votes