filtering on entire field with server-side processing on ASP Core

filtering on entire field with server-side processing on ASP Core

parcivalparcival Posts: 28Questions: 8Answers: 0

I have a datatables (with editor) setup to filter per column, with server side processing using the Editor DotNet Core module.

This setup works great, except when I need to filter on a column that is an enum stored as number in the database. Values go from 0 through 14. When I search for 0, I get 0 and 10 back. Searching for 10 only returns 10. Is there some configuration on the server side to force a full number match? When I enable RegEx and surround the query with ^ and $, SQL server does not return any data.

Thanks!

This question has an accepted answers - jump to answer

Answers

  • colincolin Posts: 15,237Questions: 1Answers: 2,599

    The server-side scripts don't support regexes by default, so you would need to add that in - there's a few threads on this that may help, such as here and here.

    Colin

  • parcivalparcival Posts: 28Questions: 8Answers: 0

    I don't need a regex search--i'm trying to match the whole number from the database. Is there a way to force the libraries to force an exact match vs a like search?
    Field = '1' vs Field LIKE '%1%'

  • colincolin Posts: 15,237Questions: 1Answers: 2,599
    Answer ✓

    Yep, those server-side scripts can be modified to do that. As I mentioned, there's a few threads discussing that,

    Colin

  • parcivalparcival Posts: 28Questions: 8Answers: 0

    Thank you! I'll keep digging :)

This discussion has been closed.