一个是使用Log去输出
http://stackoverflow.com/questions/4899974/how-to-view-linq-generated-sql-statements一个是使用SQL Server Profiler还有就是使用VS的第三方插件。
http://stackoverflow.com/questions/4899974/how-to-view-linq-generated-sql-statements一个是使用SQL Server Profiler还有就是使用VS的第三方插件。
解决方案 »
- repeater数据导出excel
- gridview显示问题
- 还是datagridview,我想在某列前或者后插入一条记录,而其它几列的值依次往后移?
- datagridview中的datapropertyname问题
- 新人请教个socket异常的问题,谢谢啦
- C#web应用程序,如何实现使用期限设置(在线等)
- 请教水晶报表的几个问题呀,在线等!一直等到12点!请帮帮我呀!:-(~~
- 程序出了错误,不知道为什么?
- 一台好的电脑配置应该是什么样的?
- !!!急!!!!datagrid 有关问题(winform)
- [WinF,事件相关] EventHandlerList 调用 Dispose,会清理资源么
- 像这样有下拉的工具是怎么做出来的?
VS咋就没有自带一个呢.这样出问题不知道语句是什么样的.不好调式.
stackoverflow.com不是山寨网站,你稍微等下再看。
VS咋就没有自带一个呢.这样出问题不知道语句是什么样的.不好调式.
stackoverflow.com不是山寨网站,你稍微等下再看。
嗯,能复制过来.或直接告诉我解决方法吗?
我用的是VS2013,自带没有能查看到SubmitChanges();提交到数据库的SQL语句吗?
VS咋就没有自带一个呢.这样出问题不知道语句是什么样的.不好调式.
stackoverflow.com不是山寨网站,你稍微等下再看。
嗯,能复制过来.或直接告诉我解决方法吗?
我用的是VS2013,自带没有能查看到SubmitChanges();提交到数据库的SQL语句吗?I do this in my base for data access objects and output it to the Visual Studio debug console. As the objects create their DataContext I check it see if its debug and attach a TextWritter helper class like this: dbDataContext _dB = new dbDataContext();
_dB.CommandTimeout = 5000;#if DEBUG
_dB.Log = new DebugTextWriter();
#endif
Here is the helper object for output to the debug console://utility class for output of TextWriter for the Visual Sudio Debug window
class DebugTextWriter : System.IO.TextWriter
{
public override void Write(char[] buffer, int index, int count)
{
System.Diagnostics.Debug.Write(new String(buffer, index, count));
} public override void Write(string value)
{
System.Diagnostics.Debug.Write(value);
} public override Encoding Encoding
{
get { return System.Text.Encoding.Default; }
}
}
还有就是linqpad和linq to sql debug visualizer
http://weblogs.asp.net/scottgu/archive/2007/07/31/linq-to-sql-debug-visualizer.aspx