Debugging error on Nullreference
I get this error when debugging my program:
System.NullReferenceException: 'Object reference not set to an instance of an object.'
Code below is the one that throws the error and I totally have no idea how to fix it. Anyone can help? Thanks a lot.
return cmd.ExecuteScalar().ToString();