Kyle Moffat Kyle Moffat - 4 years ago 212
SQL Question

MySQL Missing operand near Like

I am trying to filter a datagridview by the ID number, It keeps throwing an error ('Missing operand before 'Like' operator')

I keep getting this error only when filtering by a table ID column. It works fine if I filter by ('First_Name') or anything else but will not let me filter by ID. Any ideas?

Me.WelderNamesTableAdapter.FillBy(MacroQualityDataSet.welderNames)
Me.WelderNamesBindingSource.Filter = ("CONVERT(welderID, System.String) + [welderID] + LIKE + '%" & welderIDtxtbx.Text & "%'")

Answer Source

The + is not helping you here if welderID is a number that will not work. This might

  Me.WelderNamesTableAdapter.FillBy(MacroQualityDataSet.welderNames)
      Me.WelderNamesBindingSource.Filter = ("CONVERT(System.String,welderID) LIKE + '%" & welderIDtxtbx.Text & "%'")
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download