错误的对象引用未设置为对象的实例 [英] an error object reference is not set to an instance of object

查看:55
本文介绍了错误的对象引用未设置为对象的实例的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到一个错误,即登录期间未将对象引用设置为对象实例..在asp.net中,我的项目是医院管理系统..所以请给我解决方案

i am getting an error that object reference is not set to an instance of object during login..in asp.net my project is hospital management system..so plz give me solution

推荐答案

使用调试器,找出引发异常的代码行在哪里.

在您的IDE中,您可以使用快捷键Ctrl + Alt + E弹出异常"对话框.进行设置,以便在遇到公共语言运行时异常"时,它应闯入调试器"

现在运行您的项目.遇到异常时,它将在导致异常的行上中断.

看一下代码行.它将引用一些具有空值的变量.

看看您是否能解决该问题.如果没有,请回发导致问题的代码.
Using your debugger, find out where the line of code is that is throwing the Exception.

In your IDE, you can use shortcut key Ctrl+Alt+E to bring up with Exceptions dialog. Set that so when Common Language Runtime Exceptions are encountered, it should ''Break into the debugger''

Now run your project. When the exception is encountered, it will break on the line that caused it.

Have a look at the line of code. It''ll be referencing some variable that has a null value.

See if you can figure out how to fix it. If not, post back the code that''s causing the problem.


您正在尝试访问任何为null的对象的成员.
尝试通过源代码进行调试,以找出它为空.
You are trying to access a member of any object that is null.
Try debugging through your source code to figure out what it is that is null.


这是.NET的一般错误.
通常,当您的任何对象为NULL且您正在尝试使用它时.当时发生了此错误.

尝试调试代码并检查出哪一行会出现此错误.
This is the generic error by .NET.
Mostly, when your any object is NULL and your are trying to use it. at that time this error occoured.

Try to debug the code and checkout which line gives you this error.


这篇关于错误的对象引用未设置为对象的实例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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