在datagrid视图中对象引用未设置为实例错误 [英] object reference not set to an instance error in datagrid view

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

问题描述

在Windows应用程序窗体中,我正在使用datagrid view.将数据保存到DB之后,我得到的错误对象引用未设置为实例.我该如何克服问题

in windows appplication form i am using datagrid view.after saving data to DB,i am getting this error object reference not set to an instance.how can i overcome dis probs

推荐答案

设置一个断点并调试您的代码,否则发布您的代码,然后只有人们才能理解问题所在..

发布您的代码..
put a breakpoint and debug your code otherwise post your code then only people can understand what is the problem..

post your code ..


检查您尝试通过其属性访问的对象是否不为空.
发生这种情况时将引发此错误.
Check if an object you are trying to access via its atributes is not null.
This error is thrown when this happens.


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

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