如果列名中有空格,Linq :DataTable select 不起作用? [英] Linq :DataTable select does not work if column name has space in it?
本文介绍了如果列名中有空格,Linq :DataTable select 不起作用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想从 DataTable 中选择行.选择条件包括 anding,列名称有一个空格,如下所示:
I want to select rows from DataTable. Select criteria includes anding and the columns name have a space b/w them as you can see below:
int distributionLineIdex = import.VendorInvoiceLineDetailTable.Select
("Number='AMEX0311_00011' and Line number='001'").Count();
我收到以下异常:
Syntax error: Missing operand after 'number' operator.
我在这里错过了什么?
推荐答案
使用
[Line Number] = '001'
代替
这篇关于如果列名中有空格,Linq :DataTable select 不起作用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文