SQL not displayed Trial Version

Discussion of issues, suggestions and bugs of LINQ Insight, Visual Studio add-in for design-time executing LINQ statements, that simplifies debugging LINQ
Post Reply
ljp007
Posts: 3
Joined: Tue 04 Mar 2014 22:08

SQL not displayed Trial Version

Post by ljp007 » Tue 04 Mar 2014 22:18

Hi,

I have the VS 2013 insight express.

http://www.devart.com/linqinsight/editions.html

When I run a linq statement, nothing is appears in the SQL tab. According to the editions features, express should show the sql. How can I get the generated sql to display?

Thanks

MariiaI
Devart Team
Posts: 1472
Joined: Mon 13 Feb 2012 08:17

Re: SQL not displayed Trial Version

Post by MariiaI » Wed 05 Mar 2014 14:44

Please specify the following information:
- the OS, x64 or x86;
- the version of LINQ Insight;
- the ORM Framework you are working with;
- the type of your project, etc.

If possible, please send us a small test project and describe the steps we should follow to reproduce this issue. Looking forward to your reply.

ljp007
Posts: 3
Joined: Tue 04 Mar 2014 22:08

Re: SQL not displayed Trial Version

Post by ljp007 » Wed 05 Mar 2014 17:02

windows 7, x64 os
LinqInsight 3.0
EntityFramework, Version=6.0.0.0
Web App Project, .net 4.5 framework, with Web Forms, MVC, Web API
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" />
<providers>
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
</providers>
</entityFramework>

MariiaI
Devart Team
Posts: 1472
Joined: Mon 13 Feb 2012 08:17

Re: SQL not displayed Trial Version

Post by MariiaI » Thu 06 Mar 2014 12:38

Please specify the query you are executing. If it ends with .ToList/.Single/.First, in such cases the SQL is not shown.
Please also try the latest build of LINQ Insight and tell us about the results:
http://www.devart.com/linqinsight/download.html

ljp007
Posts: 3
Joined: Tue 04 Mar 2014 22:08

Re: SQL not displayed Trial Version

Post by ljp007 » Thu 06 Mar 2014 15:45

Below is the query. I am putting the cursor in the from section and performing the Run Linq Query in VS.

var query = (from vw in _db.vw_MER_ImpactMembers
where vw.id.Equals(accountId)
&& (fromDate <= vw.Event_Date__c || vw.Event_Date__c == null)
&& (toDate >= vw.Event_Date__c || vw.Event_Date__c == null)
&& (userRange.Equals("active") ? vw.Subscriber_Status__c.Equals(userRange) : vw.Subscriber_Status__c.Contains(userRange))
select new
{
vw.id,
vw.Name,
vw.Event_Date__c,
vw.FirstName,
vw.LastName,
vw.Title,
vw.Subscriber_Status__c
}).ToList().Select(vw => new vw_MER_ImpactMembers(){ id = vw.id,
Name = vw.Name,
Event_Date__c = vw.Event_Date__c,
FirstName = vw.FirstName, LastName = vw.LastName,
Title = vw.Title, Subscriber_Status__c = vw.Subscriber_Status__c});

MariiaI
Devart Team
Posts: 1472
Joined: Mon 13 Feb 2012 08:17

Re: SQL not displayed Trial Version

Post by MariiaI » Fri 07 Mar 2014 11:23

Thank you for the additional information. The issue is due to the fact that the .List() is used in your query.
When using, for example,

Code: Select all

 var query = (from c in db.Orders select c).ToList();
the query - is an object of the IEnumerable<T> type, and it doesn't have a method with which the SQL can be got.
While when using

Code: Select all

var query = from c in db.Orders select c;
the query - is an object of ObjectQuery type, and it has the ToTraceString() method.

This issue is related to Entity Framework only. We will investigate it in more details and inform you about the results as soon as possible.

Post Reply