Covert SQL to Linq

Yvan Rowel 1 Reputation point
2021-08-22T18:42:28.013+00:00

Hello,
I developed my program with C # using linq for the query. And I ran into a problem while converting my sql query to linq.
I don't know what to do, can you tell me the right query, please ..
Here is my sql query:

SELECT bs.idBalancesortie, bs.datesortie, bs.c_num_debut,bs.c_num_fin,bs.nombredetickets, n.quotite, bs.montant,
SUM(bs.montant) OVER(ORDER BY bs.idNature ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) as Cumul, bs.idNature
FROM BalanceSortie bs
LEFT JOIN Natures n on bs.idNature = n.idNature
order BY bs.idNature

SQL Server Other
{count} votes

2 answers

Sort by: Most helpful
  1. Sam of Simple Samples 5,546 Reputation points
    2021-08-22T19:12:16.83+00:00

    Try LINQPad.

    0 comments No comments

  2. Seeya Xi-MSFT 16,586 Reputation points
    2021-08-23T03:21:27.767+00:00

    Hi @Yvan Rowel ,

    You can try the below tools to convert it.
    https://www.linqpad.net/
    http://www.sqltolinq.com/

    Best regards,
    Seeya


    If the response is helpful, please click "Accept Answer" and upvote it, as this could help other community members looking for similar queries.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.