Page 1 of 1

SQL not displayed Trial Version

Posted: Tue 04 Mar 2014 22:18
by ljp007
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

Re: SQL not displayed Trial Version

Posted: Wed 05 Mar 2014 14:44
by MariiaI
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.

Re: SQL not displayed Trial Version

Posted: Wed 05 Mar 2014 17:02
by ljp007
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>

Re: SQL not displayed Trial Version

Posted: Thu 06 Mar 2014 12:38
by MariiaI
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

Re: SQL not displayed Trial Version

Posted: Thu 06 Mar 2014 15:45
by ljp007
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});

Re: SQL not displayed Trial Version

Posted: Fri 07 Mar 2014 11:23
by MariiaI
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.