Capture SQL Generated from Linq

Capture SQL Generated from Linq

Postby lhengen » Fri 06 Feb 2015 23:07

Is there a way to capture the SQL generated from LINQ queries short of capturing traffic sent to the RDBMS? This would be useful for learning LINQ by experimentation.
Posts: 1
Joined: Fri 06 Feb 2015 23:04

Re: Capture SQL Generated from Linq

Postby AlexP » Mon 09 Feb 2015 12:14


Yes, you can retrieve the text of the last executed SQL query, that was generated according to the LINQ query. For this, you can execute the following code:

TDataContextUtil = class(TDataContext)

You can samples in the Demo application, in the 'Working with LINQ queries' branch.
Devart Team
Posts: 5525
Joined: Tue 10 Aug 2010 11:35

Return to EntityDAC