Where="((ProgModelID == @ProgModelID) || (@ProgModelID == @ShowAll)) && (((FirstName + ' ' + MiddleName + ' ' + LastName) LIKE '%' + @Name + '%') || ((FirstName + ' ' + LastName) LIKE '%' + @Name + '%'))"
I need to concatenate the full name together when comparing against a TextBox
in order to filter a GridView
, but this error comes up when I try to run it. The error changes to Expression expected
when I place []
around each FirstName
, MiddleName
and LastName
.
Update
I have a textbox which a user can type a name into to filter a GridView
's results. the GridView
has a LinqDataSource
. The problem is the name is divided in the database into 3 parts: first, middle, last. I want to be able to filter by first+last name, as well as first+middle+last name. The areas related to ProgModel are for a DropDownList
and already function if the sections related to @Name
are removed.