简体   繁体   English

使用Linq不循环更新同一数据表

[英]update same datatable using Linq without loop

I have one datatable with 26 columns in it. 我有一个数据表,其中有26列。 I need to update specific column based on filter. 我需要根据过滤器更新特定的列。 but I dont want to do it using iteration because it's having thousands of records. 但是我不想使用迭代,因为它有成千上万的记录。 It waill affects performance. 它会影响性能。

is there any way to do that. 有没有办法做到这一点。 I am new for linq so I searched for that but not getting proper solution. 我是linq的新手,所以我进行了搜索,但未获得适当的解决方案。 There are some solutions but I can not understand it. 有一些解决方案,但我不明白。

Please if anyone having solution? 如果有人有解决方案,请吗?

This is where you have to either drop into ADO or seriously customize linq or EF. 这是您必须加入ADO或认真自定义linq或EF的地方。

Bulk inserts and updates are not something it does nicely. 批量插入和更新并不是很好。

Is batch or bulk insert possible in Linq 2 Sql ? 在Linq 2 Sql中可以批量或批量插入吗?

the same goes for EF. EF也是如此。

Multiple row update is not supported by EF. EF不支持多行更新。 For this better you use stored procedure. 为了更好地使用存储过程。 This is the reason EF has provided support for executing stored procedure. 这就是EF为执行存储过程提供支持的原因。 Use it and enjoy :) 使用它并享受:)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM