SQL Server查询可视化器–无法看到生成的SQL查询

编程入门 行业动态 更新时间:2024-10-24 20:23:09
本文介绍了SQL Server查询可视化器–无法看到生成的SQL查询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有SqlServerQueryVisualizer.当我将鼠标悬停在"accounts"变量上时,我可以看到SQL.但是,当我将鼠标悬停在结果"变量上时,它没有显示SQL查询.在以下代码中如何查看结果"变量的SQL查询?

I have SqlServerQueryVisualizer. I can see the SQL when I hover on "accounts" variable. But when I hover on "results" variable, it is not showing the SQL query. How to see the SQL query for "results" variable in the following code?

public IEnumerable<T> FindAll(Func<T, bool> predicate) { LibraryManagementClassesDataContext db = new LibraryManagementClassesDataContext(""); var accounts = from p in db.Accounts where p.AccountNumber == 1 select p; //Where var results = Context.GetTable<T>().Where(predicate); return results; }

此外,我还有一个插入功能.如何查看此情况下生成的查询?

Also, I have a insert function. How to see the generated query for this scenario?

public virtual void InsertOnSubmit(T entity) { GetTable().InsertOnSubmit(entity); }

推荐答案

问题中所述的问题仍然存在.

The problem stated in the question still exists.

当前,我正在使用以下类在输出窗口中查看结果.

Currently I am using the following class for seeing the result in output window.

context.Log = new OutputWindowWriter(); class OutputWindowWriter : 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 System.Text.Encoding Encoding { get { return System.Text.Encoding.Default; } } }

更多推荐

SQL Server查询可视化器–无法看到生成的SQL查询

本文发布于:2023-07-09 02:22:55,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1082876.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:SQL   Server

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!