0

Why the program says

An exception of type 'System.NullReferenceException' occurred in HamburgerciOrnegi.exe but was not handled in user code

I looked System.NullReferenceException entry and i can't find my answer. If you could help me , i'll be very thankful to you.

serdar al
  • 1
  • 1
  • Probably due to missing try-catch block, use try-catch block to catch it, https://msdn.microsoft.com/en-us/library/0yd65esw.aspx – Adil Mar 03 '17 at 08:04
  • 2
    No instance is created for `ManuItem` class, so without instance you can not access class property `Name`. – Bharat Mar 03 '17 at 08:06
  • You have not created an instance of the `MenuItem` class therefore the variable is `null`. Try `MenuItem = new MenuItem();` before accessing it's properties. – Dave Becker Mar 03 '17 at 08:09
  • **I am trying it but it's not working. I think i'm doing it wrong but i don't know how should i write correct.** – serdar al Mar 03 '17 at 08:22
  • Oh okay i find how to use it. Thank you :) – serdar al Mar 03 '17 at 08:34

0 Answers0