View Single Post
  #3 (permalink)  
Old August 3rd, 2011, 10:58 AM
esherr01 esherr01 is offline
Authorized User
Points: 130, Level: 2
Points: 130, Level: 2 Points: 130, Level: 2 Points: 130, Level: 2
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Jun 2011
Posts: 32
Thanks: 22
Thanked 0 Times in 0 Posts
Default Debugging LINQ value


I have scaled back my efforts (to above) in an attempt to see if I am getting proper values.

What I am looking at is:

  int recordsReturned = (from RoundOfGolf in db.RoundOfGolfs
                    where (RoundOfGolf.Customer_ID == customer && RoundOfGolf.Player_ID == player)
                    select RoundOfGolf).Count();

          amount = recordsReturned.ToString();
          TextBox rounds = ((TextBox)DetailsView1.FindControl("TextBox7"));
          rounds.Text = amount;
Where I am trying to take the returned int value recordsReturned and merely put that value into a TextBox to see if the value I'm getting is what I would expect (this value is necessary early in the previous code posted).

My error is "Object reference not set to an instance of an object" ? amount has been declared prior.

Can you help. thanks
Reply With Quote