>>Because Decimal will implicity widen to Double. You won't lose information but might lose precision. If I worked with VB.NET the first thing I'd do would be to set OPTION STRICT ON. It still allows all the implicit widening conversions but will catch a lot more potential problems at compile time
>
>When doing that, I obtain over 102 errors. Those are all with loRow() lines such as:
>
>
> ' Scan all records
> For lnCounter = 0 To loDataProvider.nCount - 1
> loRow = loDataProvider.oRows(lnCounter)
>
> ' If we have a shop
> If loRow("NoMember") > 0 Then
>
>
>This is valid code. Why is the compiler complaining now with strict on?
It may or may not be valid code. For example loRow("NoMember") in the example above is of type 'object' - which may or may not be convertible to an integer. If you want the compiler to use loRow("NoMember") as an int then, with Option Strict On, you need to explicitly cast:
If CInt(r("ColumnA")) > 0 Then..
Essentially, the compiler is pointing out that the code you have used may not work - if you know otherwise then it's up to you to cast.....