如何实例化一个 Profiled DataAdapter 以与 MVC MINI PROFILER 一起使用?
所有 Command 对象都没有 Fill 方法,但在以前的方法中,我可以实例化一个新的 OracleDataAdapter。如何实例化 Profiled DataAdapter 来使用 MVC MINI PROFILER 分析我的数据库活动?
我所需要的只是将 Fill 命令与 MVC mini Profiler 的配置连接一起使用。
[更新]
我认为很多人以前一定已经这样做过,除非他们使用实体框架,它工作得很好而且很简单。在我的例子中,查询被动态加载到数据表中,并且实体无法被映射,因为应用程序不知道它。
通过分析连接创建命令后最大的问题是将其设置为无法实例化的 DataAdapter。
[更新] 更多参考:
None of the Command objects have Fill methods, but in the former way I was doing I could instantiate a new OracleDataAdapter. How could I instantiate a Profiled DataAdapter to profile my database activity with MVC MINI PROFILER?
All I need is to use the Fill command with the profiled connection of MVC mini Profiler.
[UPDATE]
I think many must have done that before, unless they are using Entity Framework, which works nice and easy. In my case the query is loaded dynamically into a Datatable, and the entity cannot be mapped, since it is unknown by the application.
The biggest problem after creating a command by the profiled connection is to set it to a DataAdapter which cannot be instantiated.
[UPDATE] Further References:
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
根据罗里
“为此提供了一个类 ProfiledDbDataAdapter,您可以使用它来包装现有的 SqlDataAdapter。”
通过这个提示,您可以编写一些像这样的代码
,并且该代码的命名空间是:
我希望它能够工作。就我而言,它运行成功。
According to Rory
"There's a class ProfiledDbDataAdapter provided for this that you can use wrapped around your existing SqlDataAdapter."
By this hint, you can write some code like this
And namespaces for this code are:
I hope it will work. In my case, it is working successfully.