So
EX.GetValue(a, b, c)
returns a
Dataset
object. You are taking the first table, looking at the first row, and returning the value in the first column.
Problem is, that is an
Object
, and your property expects a
Decimal
. The Framework can handle this by making a best guess, but sometimes it guesses wrong. This is why I find it best to write and compile my apps with
Option Explicit = True
, which tells the compiler not to make ANY assumptions and just flag it as an error.
Try explicitly converting the result before assigning it, and see if it makes any difference:
Value = CDbl(EX.GetValue(a, b, c).Tables(0).Rows(0)(0))
The other thing to check is to verify that the value in the database is the value you are expecting: it may actually be 12 rather than 0.012.