Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
是否可以使用复制您的 SQL 连接List<T>?我以某种方式远离 DataTable 和 DataSet 的使用,并尝试使用 List 来复制它。
List<T>
绝对地。AFAIK,您可以将任何 LINQ 运算符(包括join)用于内存数据,例如List.
join
List
使用 LINQ,您几乎可以复制您用 SQL 编写的内容。:)
像这样的东西:
List<T> foo = ...; List<U> bar = ...; var query = from f in foo join b in bar on f.x = b.x select new { f, b }; foreach (var q in query) { ... }
这是我的输入
<someAccounts> <Account> <type>ABC</type> <number>123456789</number>