本文介紹了如何從 LINQ DataContext.SubmitChanges() 獲取 TSQL 查詢的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!
問題描述
我正在使用 Linq to SQL.我有一個 DataContext,我正在針對它 .SubmitChanges()'ing.插入身份字段時出錯,我想查看它用于插入此身份字段的查詢.
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.
我在 quickwatch 中沒有看到查詢本身;我在哪里可以從調試器中找到它?
I don't see the query itself within the quickwatch; where can I find it from within the debugger?
推薦答案
其實你的問題有一個很簡單的答案
There is actually a very simple answer to your question
只需將其粘貼到您的觀察窗口中
Just paste this in your watch window
((System.Data.Objects.ObjectQuery)myLinqQueryVar).ToTraceString()
這篇關于如何從 LINQ DataContext.SubmitChanges() 獲取 TSQL 查詢的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!
【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!