문제

Is there a way to get the SQL script that will be run when calling a Context.SubmitChanges()?

도움이 되었습니까?

해결책

The Log property of the DataContext object can be assigned a TextWriter that will be written to with the SQL generated by the request.

Also, see www.linqpad.net for an awesome tool to help diagnose and test Linq-To-SQL queries which has a results window that shows what SQL was generated.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top