I got a problem with filtering datatables. One Column is calles BANF-Nummer. Using a filter, I got a error message. I wrote the following code for that:
FilterExpression = "(Kontierungsobjekt = 'Kostenstelle' OR Kontierungsobjekt = 'Co-Auftrag') AND BANF-Nummer > '-1'";
dv.RowFilter = FilterExpression; //ERROR!
The error message is:
Cannot find column [Nummer]
There is another post with a similar problem linked below: Unable to Have (-) Dash in DataView Filter C#
This fix doesn't solve my problem. If I try this:
FilterExpression = "(Kontierungsobjekt = 'Kostenstelle' OR Kontierungsobjekt = 'Co-Auftrag') AND [BANF-Nummer] > '-1'";
dv.RowFilter = FilterExpression; //ERROR!
The error message is then:
Cannot find column [BANF-Nummer]
If I test this function with another column, for example Kostenstelle, it works perfectly. So the error is definitive in the name BANF-Nummer, I cannot change.
Here a screenshot of my problem: enter image description here
Would be grateful for every advice.