Building and Using a LINQ for SQL Class Library with ASP.NET 2.0
page 7 of 9
by Scott Guthrie
Feedback
Average Rating: This article has not yet been rated.
Views (Total / Last 10 Days): 43161/ 69

Step 6: Using Debug Visualizers to inspect what SQL is executed against the database

One of the most common questions people wonder when using ORM data frameworks is, "so what SQL code is it running under the covers?"  LINQ makes it easy to figure this out.  Just set a debugging breakpoint on a LINQ expression variable and you can use a built-in LINQ debugging visualizer to inspect it while debugging. 

For example, set a breakpoint on the DataList1.DataBind() method above and when it is hit, hover your mouse over the DataList1.DataSource property and click the magnifying glass to launch its DLINQ query visualizer.

Figure 10

This will bring up a visualizer dialog that displays the SQL statement that LINQ will execute against the database when evaluating that LINQ expression.

Figure 11

If you click the "execute" button on the bottom-right you can even test out the query in the debugger and see the exact data that will be returned from it when the supplier name is "Exotic Liquids.

Figure 12

This makes it really easy to see the exact SQL that is executed and closely watch what is going on as you modify and refine your LINQ queries.


View Entire Article

User Comments

Title: ras   
Name: rasd
Date: 2012-05-05 4:29:50 AM
Comment:
dfasd
Title: How to integrate with XLINQ in eixsting applications   
Name: Senthil
Date: 2008-12-17 12:20:06 AM
Comment:
How to integrate with XLINQ in eixsting applications?
Title: nice   
Name: john
Date: 2006-09-20 5:21:27 AM
Comment:
nice.. that give me a point






Community Advice: ASP | SQL | XML | Regular Expressions | Windows


©Copyright 1998-2024 ASPAlliance.com  |  Page Processed at 2024-04-26 8:00:25 PM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search