Here's what I'm trying to do:
if (!cmd.ExecuteScalar().Equals(DBNull.Value))
return Int32.Parse(cmd.ExecuteScalar().ToString());
else
return 0; But it keeps giving me an error, saying:
Object reference not set to an instance of an object.
The error is at the if statement when I'm doing cmd.ExecuteScalar().
...
Go to the complete details ...