【发布时间】:2014-03-05 22:08:24
【问题描述】:
我有以下代码:
//myDataTable has the following collumns: UserName, Birthday and email.
string name = "eric!";
string expression = "UserName = " + name;
DataRow[] result = myDataTable.Select(expression);
我想选择名称为“eric!”的所有行。
这 ”!”给我以下错误:
无法解释标记“!”。
如何选择具有此类标记的所有行?
(我真的需要表达式中的“!”,因为我从 .sql 文件中提取了用户名)
【问题讨论】:
标签: c# datatable syntax-error expression token