这是我的代码:
DataSet ds = new DataSet();
ds.ReadXml("drivers");
这是正常的代码:
var q = from drivers in ds.Tables[0]
.Select("EmployeeNumber = " + "0000008823")
select (drivers["EmployeeNumber"] + " - " + drivers["Name"]);
相同的代码,但此代码给出了错误:
var q = from drivers in ds.Tables[0]
.Select("EmployeeNumber = " + "0000000023")
select (drivers["EmployeeNumber"] + " - " + drivers["Name"]);
无法对 System.String 和 System.Int32 执行“=”操作
这是我的 xml 文件:
<?xml version="1.0" encoding="utf-8"?>
<drivers>
<Driver>
<Name>John</Name>
<EmployeeNumber>0000000023</EmployeeNumber>
</Driver>
<Driver>
<Name>Mike</Name>
<EmployeeNumber>0000008823</EmployeeNumber>
</Driver>
</drivers>