开发者

Help to convert the SQL query to Lambda(Linq)

开发者 https://www.devze.com 2023-03-25 17:03 出处:网络
Can anyone help me, to convert the below sql query to Linq (Lambda Expressions). Thanks in Advance. SQL Query:

Can anyone help me, to convert the below sql query to Linq (Lambda Expressions). Thanks in Advance.

SQL Query:

UPDATE A INNER JOIN B ON (A.Trade Number=B.Trade Number) AND (A.AccountId=B.AccountId) SET A.Float = B.CCY, A.Fl开发者_开发技巧oat = B.BASIS, A.LastReset = B.FIXING, A.LastLibor = B.INTRATE;


Updates are not expressed as LINQ statements. You can use LINQ to load the record you wish to modify, but the actual update will involve a separate method call, the details of which will depend on which database technology you're using.

So, assuming you already have a reference to the record you wish to update from A, load the associated record from B (using LINQ), perform the updates to A programatically, and then save the changes to A.

Here's an example using LINQ-to-SQL.

0

精彩评论

暂无评论...
验证码 换一张
取 消