I stumbled upon this issue:
myObject‘s class has a public field MyField which type is Decimal?
I accidentally access the field as if it were a property with this code:
myObject.MyField()
instead of
myObject.MyField
And I got the following error from the compiler: Structure 'Decimal?' cannot be indexed because it has no default property
Documentation on this error on MSND is very short and I just don’t understand what it means.
Q: What’s the meaning of myObject.MyField() if it has one, and why can’t I use it on my field if so?
Note: my problem is now solved but I would like to understand…
You access elements of an array using
()in VB.NET. The error message is telling youStructure 'Decimal?' cannot be indexedbecause it can’t.