Вопрос

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