Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3218206
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T15:30:03+00:00 2026-05-17T15:30:03+00:00

I an using VS2010, .NET4 and EF4. I would like to see the actual

  • 0

I an using VS2010, .NET4 and EF4. I would like to see the actual SQL that is generated when this is run. Also, what is this the best way to write this statement?

Here is my code:

var cklContactItems = from a in dbTestCenterViews.appvuChecklistExports
                                   where a.MarketChecklistID == MCLID 
                                        && a.checklistSectionID == SID 
                                        && a.fieldGroupOrder != null
                                   orderby a.fieldGroupOrder ascending
                                   select new { a.Column1, a.Column2, a.Column3, a.Column4, a.Column5,a.Column1FieldID,a.Column2FieldID,a.Column3FieldID,a.Column4FieldID,a.Column5FieldID,a.fieldGroupOrderLabel };
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T15:30:03+00:00Added an answer on May 17, 2026 at 3:30 pm
    var query = (from x in context.MyEntity where x... select x);
    
    (query as ObjectQuery<MyEntity>).ToTraceString();
    

    That will print to the trace log… if you want a simple trace viewer (outside of Visual Studio) check out DebugView

    And as an additional side note, the best “real time” profiler I have used/seen out there is Entity Framework Profiler, you have to pay for it, but there is a trial version available, and it will give you SQL matched to the line of code. It also recognizes common “issues.” Setup is stupid simple… all you have to add is one statement in the initializer of your application.


    **Edit updated to show how to do it with users code **

    I guess i can do all the hard work for you… ;). Since you use an annoynmous type just leave off the <T> part.

    var cklContactItems = from a in dbTestCenterViews.appvuChecklistExports
                                   where a.MarketChecklistID == MCLID 
                                        && a.checklistSectionID == SID 
                                        && a.fieldGroupOrder != null
                                   orderby a.fieldGroupOrder ascending
                                   select new {
                                       a.Column1, 
                                       a.Column2, 
                                       a.Column3, 
                                       a.Column4,
                                       a.Column5,
                                       a.Column1FieldID,
                                       a.Column2FieldID,
                                       a.Column3FieldID,
                                       a.Column4FieldID,
                                       a.Column5FieldID,
                                       a.fieldGroupOrderLabel 
                                      };
    
    System.Diagnostics.Trace.WriteLine((query as ObjectQuery).ToTraceString());
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We're using EF4 in a fairly large system and occasionally run into problems due
Using ASP.NET MVC there are situations (such as form submission) that may require a
Using TortoiseSVN against VisualSVN I delete a source file that I should not have
Using C#, I need a class called User that has a username, password, active
Using preview 4 of ASP.NET MVC Code like: <%= Html.CheckBox( myCheckBox, Click Here, True,
Can someone provide me with a HelloWorld JQuery sample app using VS2010 and list
I have a WPF application running with VS2010 .Net3.5 using Nhibernate with FluentNHibernate +
I tried file system publish and ftp I'm using VS2010 and .net 4.0 should
I am using MVC2 in VS2010 with .Net 4.0. I have a situation in
Using online interfaces to a version control system is a nice way to have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.