Linq:如果列名称中有空格,则DataTable select不起作用 [英] Linq :DataTable select does not work if column name has space in it?

查看:688
本文介绍了Linq:如果列名称中有空格,则DataTable select不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想从DataTable中选择行。选择条件包括anding,列名称具有空格b / w,如下所示:

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.


我在这里缺少什么?

What am I missing here ?

推荐答案

使用

[Line Number] = '001'

而不是

这篇关于Linq:如果列名称中有空格,则DataTable select不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆