SyntaxFix
Write A Post
Hire A Developer
Questions
Try this one, if null set 0 or something
return command.ExecuteScalar() == DBNull.Value ? 0 : (double)command.ExecuteScalar();