【发布时间】:2012-06-27 10:08:16
【问题描述】:
我有一个名为dt 的DataTable。它有两个名为 atype_code 和 module 的列。
现在我需要根据特定的atype_code 查询一个模块。
这是我写的代码,但不能正常工作。
DataTable dt = GetATypeCodeList();
var accType = (from myAccType in dt.AsEnumerable()
where myAccType.Field<string>("atype_code") == aTypeCode.Trim()
select myAccType.Field<string>("module"));
acctype 是 System.Data.EnumerableRowCollection<System.String>。
【问题讨论】:
-
accType 显示 {System.Data.EnumerableRowCollection