Thursday, November 22, 2007 5:40 AM
As topic. How can I do it?
I know how to do it in LINQ to SQL , but not for Entity Framework.
Thursday, November 22, 2007 8:56 PMAnd how do you do it with LINQ to SQL?
Thursday, November 22, 2007 10:48 PM
PublicClass Formdemo Private db As New LinqSql.ProductDataContext()
PrivateSub Formdemo_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
db.Log = Console.Out 'Add This Line to Your application , and you can view the Sql Statement in the OutPut Windows when Debug the Program'Dim emplist = From emp In db.Employees _ ' Where emp.Id < 20 _ ' Select emp 'Me.EmployeeBindingSource.DataSource = emplist
Thursday, November 22, 2007 10:53 PMHello Gordon,
theres a tool for SQL Server thats called "Profiler". You can view every SQL Statement that is reveived by the Sql server.
Of Course - you have to work a little with the Debugger to find that out.
It's maybe not the most beautiful way, buts it works until you can find a way that suits better your needs.
Friday, November 23, 2007 1:00 AM
Thansk very much Esrever,
I have used the Sql Profiler before, but I dont want to used it in this Case,
as you said, it will be the last solution if there is really no other ways to do it.
Friday, November 23, 2007 1:17 AM
Friday, November 23, 2007 11:20 PM
try install SQLDeveloper edition. It has enterprise edition level features (including profiler) but it is used for developemtn only
Aurelian POPA [MVP]
Saturday, November 24, 2007 7:45 PM
I beleve the request is how to look at the query in debug mode when querying against EDM in the same way you can with LINQ to SQL, as opposed to using SQL Profiler.
The trick for it is to get tot eh ENtity Command tree and in there, is the TSQL.
HEre's a previous thread that shows how to accomplish this.
Sunday, November 25, 2007 3:19 AM
In addition there is a new feature that will arrive with beta 3 of the entity framework (getting closer but still not quite ready yet) that will make this much easier...
Tuesday, December 04, 2007 1:12 AMThanks Julie Lerman
you're right. that is waht I need.
But it is a little bit complex.
Friday, December 07, 2007 9:06 PM
>> In addition there is a new feature that will arrive with beta 3 of the entity framework (getting closer but still not quite ready yet) that will make this much easier...
Any update on what this "feature" is and how to use it now that Beta 3 is out?
Friday, December 07, 2007 9:22 PM
I believe this is implemented through a method named ToTraceString(). If I figure out how to use it before you do, I'll let you know. ;-) and vice-versa.
Friday, December 07, 2007 9:26 PM
Never mind...its doc'd (with example) in the API reference.
Friday, May 23, 2008 2:38 PM
I have visual studio 2008 sp1 installed.
Where's this new feature?
Friday, May 23, 2008 3:54 PMThere is now a ToTraceString() method on both ObjectQuery and EntityCommand, which returns the store-provider's query statement.
Friday, February 17, 2012 5:20 PMhow you do it in linq to sql man ?? I need to know please !