✅ 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
Angius
Angius2y ago
Well, something is null Could be DC Could be txtPropertyID
SETTLE DOWN191
SETTLE DOWN191OP2y ago
How do I check? I'm such a noob as I only started c# last week
Angius
Angius2y ago
$debug
MODiX
MODiX2y ago
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.
Angius
Angius2y ago
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 exception
SETTLE DOWN191
SETTLE DOWN191OP2y ago
I've figured out that DC is null. But now I have no idea how to change it so it's not null.
Angius
Angius2y ago
Well, you need to initialize it with some value
Accord
Accord2y ago
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.

Did you find this page helpful?