简体   繁体   English

我如何查看将运行ASP SqlDataSource的实际SQL(绑定后)

[英]How can I see the actual SQL an ASP SqlDataSource will run (after binding)

This is a very simple question, but one I can't find an answer to. 这是一个非常简单的问题,但我找不到答案。 If I have an SqlDataSource that takes parameters, how can I see the actual SQL that will be executed against the DB after the binding takes place? 如果我有一个带参数的SqlDataSource,如何查看绑定发生后将对DB执行的实际SQL? (I have tried adding a breakpoint to code on the onBinding event of the SqlDataSource) (我尝试将断点添加到SqlDataSource的onBinding事件上的代码中)

Thanks for any help 谢谢你的帮助

Ryan 瑞安

You will need to use a profiling tool at the database end to get the actual SQL executed. 您将需要在数据库端使用分析工具来执行实际的SQL。 For Sql Server you can use Sql Profiler . 对于Sql Server,可以使用Sql Profiler

SqlDataSource.SelectCommand应该向您显示将要执行的命令的文本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM