【发布时间】:2012-10-15 10:17:19
【问题描述】:
我正在尝试在 GridView 中显示 Excel 工作表和 sql server 数据表之间的重复行。
这是我的代码:
var matched = (from table1 in dt4.AsEnumerable()
join table2 in oltlb.AsEnumerable() on
table1.Field<int>("ID") equals table2.Field<int>("ID")
where table1.Field<string>("Data") == table2.Field<string>("Data")
select table1);
DataTable dthi5 = new DataTable();
dthi5 = matched.CopyToDataTable();
我可以在 GridView 中显示 var 的值吗?
【问题讨论】:
-
尝试将其转换为 .ToList();
-
请您指定我需要在哪里添加 .ToList()?我是初学者。
-
尝试将
dth15绑定到GridView -
你的例子出了点大问题!
标签: c# asp.net sql-server linq