“对象引用未设置为对象的实例”错误消息 - C#app [英] "object reference not set to an instance of an object" error message - C# app

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

问题描述

大家好,


我希望有人能帮助我。


我有一个我在MS Visual Studio 2005 Pro,C#中开发的应用程序。我连接到SQL服务器数据库。突然之间,每当我尝试添加新的或将现有数据绑定更改为文本框(作为示例)时,它就会给出错误,对象引用未设置为对象的实例。


澄清...当我点击文本时,会发生此错误。或标签数据绑定属性中的字段...所以我甚至没有机会尝试更改它,因为一旦我点击属性就会弹出错误。


我的应用程序仍然编译并运行正常......我无法更改任何控件的数据绑定,或添加任何新的数据绑定。有谁知道到底发生了什么事?


另外......我已经做过干净了并重新编译项目,这没有帮助。我还安装了服务包2,希望它有所帮助,但无济于事。


任何帮助都将不胜感激。

解决方案

< blockquote>


大家好,


我希望有人可以帮我这个。


我有一个我在MS Visual Studio 2005 Pro,C#中开发的应用程序。我连接到SQL服务器数据库。突然之间,每当我尝试添加新的或将现有数据绑定更改为文本框(作为示例)时,它就会给出错误,对象引用未设置为对象的实例。


澄清...当我点击文本时,会发生此错误。或标签数据绑定属性中的字段...所以我甚至没有机会尝试更改它,因为一旦我点击属性就会弹出错误。


我的应用程序仍然编译并运行正常......我无法更改任何控件的数据绑定,或添加任何新的数据绑定。有谁知道到底发生了什么事?


另外......我已经做过干净了并重新编译项目,这没有帮助。我还安装了服务包2,希望它会有所帮助,但无济于事。


任何帮助将不胜感激。



只是为了澄清......问题是在IDE中的设计模式不在运行时?



只是为了澄清......问题是在IDE中的设计模式而不是在运行时?



这是正确的。该应用程序编译,发布和运行就好了。一切都很好,直到大约3天前,当这个问题突然发生时。


你最近是否删除了数据绑定源或其他什么?

我建议调查设计师代码并看看你是否看到任何时髦的东西?

此外,有时完全关闭程序(不仅仅是项目/解决方案)并重新打开它。

Hello all,

I''m hoping somebody can help me with this.

I have an app that I''ve been developing in MS Visual Studio 2005 Pro, C#. I have connectivity to a SQL server database. All of the sudden, whenever I try to add a new or change an existing data binding to a text box (as an example), it gives me the error, "object reference not set to an instance of an object".

To clarify... this error occurs when I click on the "text" or "tag" field in the data bindings properties... so I don''t even get a chance to try to change it because the error pops up as soon as I click on the property.

My app still compiles and runs fine as is... I just can''t change the data binding for any controls, or add any new data bindings. Does anyone know what the heck is going on?

Also... I''ve already done a "clean" and a recompile on the project and that didn''t help. I also installed service pack 2 hoping it would help, but to no avail.

Any help will be greatly appreciated.

解决方案

Hello all,

I''m hoping somebody can help me with this.

I have an app that I''ve been developing in MS Visual Studio 2005 Pro, C#. I have connectivity to a SQL server database. All of the sudden, whenever I try to add a new or change an existing data binding to a text box (as an example), it gives me the error, "object reference not set to an instance of an object".

To clarify... this error occurs when I click on the "text" or "tag" field in the data bindings properties... so I don''t even get a chance to try to change it because the error pops up as soon as I click on the property.

My app still compiles and runs fine as is... I just can''t change the data binding for any controls, or add any new data bindings. Does anyone know what the heck is going on?

Also... I''ve already done a "clean" and a recompile on the project and that didn''t help. I also installed service pack 2 hoping it would help, but to no avail.

Any help will be greatly appreciated.

Just to clarify...the issue is in design mode in the IDE not at runtime?


Just to clarify...the issue is in design mode in the IDE not at runtime?

That is correct. The app compiles, publishes and runs just fine. Everything was fine until about 3 days ago, when this problem started out of nowhere.


Did you recently delete a databindingsource or anything?
I would suggest looking into the designer code and see if you see anything funky?
Also, sometimes closing out of the program entirely(not just the project/solution) and re-opening it works.


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

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