BindingSource.Filter Not Working (At all)

I can't seem to get the filter on my bindingsource to work

this code is from the MSDN library

(http://msdn2.microsoft.com/en-us/library/69c06922.aspx)

Its supposed to return all rows in the dataset where the companyname starts with B

BindingSource.Filter = "CompanyName like 'B'"

converted to my Code (im calling it from a different form)

FrmMain.BS1.Filter = "AccountCode like '01'"

and it doesn't return anything at all

if i make it

FrmMain.BS1.Filter = "AccountCode like '01000001'"

i get one record returned (which is correct)

Is there anyway to make this filter work to display all records that start with "0"

Has anyone come across this I need to be able to filter by accountcode, then possibly by another field as well. Is this straightforward to do Or do i need to do something else

I just finally got my data to a point where i can extract it to excel and now i can define what i want to extract.



Answer this question

BindingSource.Filter Not Working (At all)

  • bberndt

    I fixed it :)

    Need to use a wildcard

    i

    FrmMain.BS1.Filter = "AccountCode like '0*'" ' * is wildcard

    then just use all the normal operators :)


  • BindingSource.Filter Not Working (At all)