Linq: choosing DataTable doesn't work if there is a space in it?

I want to select rows from a DataTable. Selection criteria include andhing and the column name has a b / w space, as you can see below:

int distributionLineIdex = import.VendorInvoiceLineDetailTable.Select    
       ("Number='AMEX0311_00011' and Line number='001'").Count();

I get the following exception:

Syntax error: Missing operand after 'number' operator.

enter image description here What am I missing here?

+3
source share
2 answers

Using

[Line Number] = '001'

instead

+10
source

This is also true when the field name in the DataTable is numeric. In this case, use:

[2] = 7878 AND [6] = 'eee'
+1
source

All Articles