空引用异常未处理?错误 [英] Null Reference Excepion was Unhandled ? ERROR
本文介绍了空引用异常未处理?错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
这是我用sql表填充数据集表的代码
this is my code to fill my dataset table with the sql table
private void Main_form_Load(object sender, EventArgs e)
{
this.costumer_memberTableAdapter.Fill(this.sarsdatabaseDataSet.Costumer_member);
this.flight_ReservationTableAdapter.Fill(this.sarsdatabaseDataSet.Flight_Reservation);
this.car_ReservationTableAdapter.Fill(this.sarsdatabaseDataSet.Car_Reservation);
this.car_InforamtionTableAdapter.Fill(this.sarsdatabaseDataSet.Car_Inforamtion);
this.car_InforamtionTableAdapter.Fill(this.sarsdatabaseDataSet.Car_Inforamtion);
this.costumer_memberTableAdapter.Fill(this.sarsdatabaseDataSet.Costumer_member);
this.hotel_InforamtionTableAdapter1.Fill(this.sarsdatabaseDataSet.Hotel_Inforamtion);
this.hotel_ReservationTableAdapter.Fill(this.sarsdatabaseDataSet.Hotel_Reservation);
flight_informationTableAdapter.Fill(sarsdatabaseDataSet.Flight_information);
Login_Form m = new Login_Form(this);
m.ShowDialog();
this.Hide();
}
但是!!!
出现一个表示
的异常错误
("未处理空引用异常
对象引用未设置为对象的实例")
但我的表都不为空,这是什么错误,我该如何解决
在Advance中致谢
but!!!
there an Exception error that said
(''"Null Reference Exception Was Unhandled
Object reference not set to an instance of an object''")
but none of my table is null , what is this error and how can i solve it
Thanks in Advance
推荐答案
您将不得不告诉我们哪一行引发了异常.
将您的代码放在try/catch
块中,然后在调试器下运行它以找出问题所在.我敢打赌,您将能够找到自己的答案.
You''re going to have to tell us which line is throwing the exception.
Put your code in atry/catch
block, and run it under the debugger to find out where the problem is. I bet you''ll be able to find your own answer.
这种错误无需发布.通过使用try
和catch
或放置断点并开始调试,可以轻松地跟踪它.您必须学习如何调试代码.
问候,
爱德华(Eduard)
This kind of error doesn''t need to be posted. It can be easily traced by usingtry
andcatch
or by putting breakpoints and start debugging. You must learn how to debug your code.
Regards,
Eduard
您所有的this.xxx_memberTableAdapter
是否存在/已实例化?
您所有的this.sarsdatabaseDataSet.xxx_member
是否存在/被实例化?
Do all yoursthis.xxx_memberTableAdapter
exist/are instantiated?
Do all yoursthis.sarsdatabaseDataSet.xxx_member
exist/are instantiated?
这篇关于空引用异常未处理?错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文