Click here to Skip to main content
15,889,852 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
this is my code to fill my dataset table with the sql table

C#
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();           
}


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
Posted
Updated 5-Dec-11 9:51am
v2

You're going to have to tell us which line is throwing the exception.

Put your code in a try/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.
 
Share this answer
 
This kind of error doesn't need to be posted. It can be easily traced by using try and catch or by putting breakpoints and start debugging. You must learn how to debug your code.

Regards,
Eduard
 
Share this answer
 
Do all yours this.xxx_memberTableAdapter exist/are instantiated?
Do all yours this.sarsdatabaseDataSet.xxx_member exist/are instantiated?
 
Share this answer
 
Comments
rawa1990 5-Dec-11 16:03pm    
yes
emardini 5-Dec-11 18:03pm    
ok, which line is raising the exception?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900