Data Type Changes

In the move to .NET, Visual Basic's data types were adjusted in a couple of ways. I will go into more detail on integers and variants, but here is a quick summary of the changes:

  • The Currency data type has been removed completely, but you can use the Decimal data type instead.

  • Date values in Visual Basic 6.0 were stored as Doubles, and programmers often manipulated them as such, but in Visual Basic .NET DateTime values are stored as 64-bit integers instead. If you need to convert a .NET DateTime value into or from a Double, you can use the System.DateTime.ToOADate or FromOADate methods.

  • Integers were 16-bit values in VB6, they are now 32-bit. Longs have also moved from 32-bit to 64-bit, and a new data type (Short) has been added ...

Get Microsoft® Visual Basic® .NET 2003 Kick Start now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.