How to get the TSQL Query from LINQ DataContext.SubmitChanges()
问题 I'm using Linq to SQL. I have a DataContext against which I am .SubmitChanges()'ing. There is an error inserting the identity field, and I'd like to see the query it's using to insert this identity field. I don't see the query itself within the quickwatch; where can I find it from within the debugger? 回答1: There is actually a very simple answer to your question Just paste this in your watch window ((System.Data.Objects.ObjectQuery)myLinqQueryVar).ToTraceString() 回答2: Lots of people have been