如何使用服务器模式在网格视图中获取异常详细信息?
我有一个绑定到 EntityInstantFeedbackSource 的 DevExpress GridView。数据加载和页面都很好。当我尝试按视图中的列进行分组时,出现问题。网格中的所有行都会消失,并且我收到错误工具提示。然而,工具提示中的文本被截断,这意味着我看不到全部内容。
根据 DevExpress 支持站点的建议,我向默认工具提示控制器的 BeforeShow 事件添加了一个处理程序,以便可以显示从数据源返回的错误消息。这使我可以看到整个错误消息。问题是,消息说
数据库错误 - 执行命令定义时发生错误。有关详细信息,请参阅内部异常。
当此工具提示显示在视图中时,异常早已消失。有什么办法可以在它消失之前捕获它所包含的信息吗?
我尝试通过在 VS2010 的“调试”->“异常”对话框中的“公共语言运行时异常”项上选中“抛出”来让调试器抛出所有 CLR 异常,但这不起作用。
I have a DevExpress GridView bound to an EntityInstantFeedbackSource. The data loads and pages just fine. My problem occurs when I try to group by a column in the view. All of the rows in the grid disappear and I get an error tooltip. The text in the tooltip is cut off, however, meaning I can't see all of it.
Taking suggestions from DevExpress support site, I've added a handler to the default tooltip controller's BeforeShow event so that I can show error messages returned from the data source. This allows me to see the entire error message. The problem is, the message says
Database error - An error occurred while executing the command definition. See the inner exception for details.
The exception is long gone by the time this tooltip is presented in the view. Is there any way to capture the information it contains before it is gone?
I tried making the debugger throw all CLR exceptions by checking "Thrown" on the "Common Language Runtime Exceptions" item in the Debug->Exceptions dialog in VS2010, but that didn't work.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在 DevExpress 的帮助下解决了这个问题。要在运行时查看异常,我需要在 Visual Studio 调试器中关闭“仅我的代码”,如下所述: http://msdn.microsoft.com/en-us/library/h5e30exc%28v=vs.100%29.aspx
结果我使用的是过时版本的 MySQLConnector .NET。旧版本中的一个已知分组错误会产生以下错误:
“‘字段列表’中存在未知列‘GroupBy1.K1’”
Solved it with some help from DevExpress. To see the exception at runtime, I needed to turn off "Just My Code" in the Visual Studio debugger, as explained here: http://msdn.microsoft.com/en-us/library/h5e30exc%28v=vs.100%29.aspx
Turns out I was using an outdated version of MySQLConnector .NET. A known grouping bug in older versions produces the following error:
"Unknown column 'GroupBy1.K1' in 'field list'"