Change this:
result = (result == DBNull.Value) ? null : result;
To this:
result = (result == DBNull.Value) ? 0: result;
>> what exactly the DBNull does
The documentation is always your friend:
https://docs.microsoft.com/en-us/dotnet/api/system.dbnull?view=netframework-4.8
The DBNull class represents a nonexistent value. In a database, for example, a column in a row of a table might not contain any data whatsoever. That is, the column is considered to not exist at all instead of merely not having a value. A DBNull object represents the nonexistent column.
Thank you very much for detailed feedback.
Convert.ToDecimal will return a 0 with a null string.
if 10.1 comes back form the database, it should be 10.1 in the tetbox. If you want 0.0 displayed, you'll likely need to format it.
Any reason you just don't display what comes back with forced string formatting without calling Convert.ToDecimal?
https://docs.microsoft.com/en-us/dotnet/standard/base-types/standard-numeric-format-strings