某些命令未执行 [英] Certain commands are not executing

查看:70
本文介绍了某些命令未执行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我在Form Load事件中有一些代码.很好.但是,当从数据库中选择数据时,此后将不再执行任何命令.完全没有错误,但是只是保持沉默.
我对其进行了如下测试:

Hi,
I have some code in Form Load event. It is doing fine. But when it reaches to pick data from database, no commands are executing after that. There is no error at all but it just goes silent.
I tested it as follows:

MsgBox("1")
vrStudentName = PprStatusfromEnrSummary.tblPaperEnrSummary.Rows(0).Item("StudentName")
MsgBox("2")


消息框一显示数据,而不显示消息框二.实际上,第二个消息框语句根本不显示任何响应.
请指教.

谢谢
Furqan


Message Box one is showing data but not the message box two. In fact, the second message box statement is not showing any response at all.
Please advise.

Thanks
Furqan

推荐答案

可能是您有一个活动的Try-catch块正在吞噬该错误.
在VS中,在菜单栏上查找"Debug ... Exceptions".
在出现的对话框中,在"Thrown"和"Unhandled"下的每个复选框中打勾.按确定.
现在,当您通过调试器运行应用程序时,即使有活动的处理程序,它也会因任何异常而中断.这应该可以帮助您找到问题所在.
The chances are that you have an active Try-catch block which is swallowing the error.
In VS, look on the menu bar for "Debug...Exceptions".
In the dialog that comes up, put a tick in every checkbox under both "Thrown" and "Unhandled". Press OK.
Now, when you run your app though the debugger, it will break for any exception, even if you have an active handler. This should help you track down the problem.


我希望您确实单击消息框1上的确定"-因为消息框2仅在关闭1时才会显示(代码行之后执行并显示消息框2.)
I hope you do click on "Ok" on message box one - because message box 2 will only show when 1 is closed (The line of code after that executes and message box 2 is shown).


这都是关于异常的内容. 也许使用它们的一些基本指导会有所帮助.它还可以帮助您正确报告针对CodeProject问题的发布.
参见:
我如何制作滚动条到达底部时将停止的循环 [当我运行应用程序时,异常是捕获了如何处理? [ throw. .then ... rethrowing [ ^ ].

—SA
This is all about exceptions.
Maybe some elementary directions on using them will help. It also should help you to report issued for a CodeProject Question properly.
See:
How do i make a loop that will stop when a scrollbar reaches the bottom[^],
When i run an application an exception is caught how to handle this?[^],
throw . .then ... rethrowing[^].

—SA


这篇关于某些命令未执行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆