.net桌面应用程序 [英] .net desktop application

查看:83
本文介绍了.net桌面应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图从数据库访问该过程此错误发生对象引用未设置为对象的实例是什么意思?

i was trying to access the procedure from database this error occures "object reference not set to an instance of an object" what does it mean?

推荐答案

它意味着在某个地方,不知何故,你有一个你试图用来访问类数据或方法的变量,但是值为null - 没有加载类的实例。



我们无法准确,因为我们无法看到您的代码,但一般来说,Visual Studio在发生这种情况时非常有用。



当您收到错误并发生异常时,如果您没有处理它,那么您的代码执行将停止。将突出显示导致问题的行。您所要做的就是查看代码的各个部分(从右侧开始,但在任何等号后),找出哪个类实例为null。如果您无法立即发现它,请尝试将鼠标悬停在变量名称上 - 它会自动显示该值。
It means that somewhere, somehow, you have a variable which you are trying to use to access class data or methods, but the value is null - there is no instance of the class loaded into it.

We can't be precise, since we can't see your code, but generally, Visual Studio is quite helpful when this occurs.

When you get the error, and exception occurs and if you aren't handling it then your code execution stops. The line that caused the problem will be highlighted. All you have to do is look though the various parts of the code (starting at the right, but after any equals sign) to find out which class instance is null. If you can't spot it immediately, try hovering the mouse over the variable name - it will show the value automatically.


这篇关于.net桌面应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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