✅ System.NullReferenceException
I need some help. I keep getting this error and I'm not sure why. I'm very new to c#. Thank you for any help!!
8 Replies
Well, something is
null
Could be DC
Could be txtPropertyID
How do I check? I'm such a noob as I only started c# last week
$debug
Tutorial: Debug C# code - Visual Studio (Windows)
Learn features of the Visual Studio debugger and how to start the debugger, step through code, and inspect data in a C# application.
With the debugger
And/or analyzing the code
For example, if the piece of code that wants to use
Foo
runs before the piece of code that gives Foo
it's value, you'll get an exceptionI've figured out that DC is null. But now I have no idea how to change it so it's not null.
Well, you need to initialize it with some value
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.