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
SQL not displayed Trial Version
Re: SQL not displayed Trial Version
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.
- 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
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>
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
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
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
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});
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
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,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 usingthe 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.
When using, for example,
Code: Select all
var query = (from c in db.Orders select c).ToList();
While when using
Code: Select all
var query = from c in db.Orders select c;
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.