In this lesson, you will familiarize yourself with the Visual Studio VB.NET accepted data types.
A “data type” is a class that is primarily used just to hold data. This is different from most other classes since they’re primarily intended to ‘do something’, like access a database or or format a page for example. Although data types can “do something” as well (that is, they also have methods), this isn’t their main purpose.
The list below shows the data types that are defined in the .NET System namespace.
Boolean – true or false
Byte – 8 bit unsigned integer
Char – 16 bit Unicode character
DateTime – date and time of day
Decimal – decimal number
Double – 64 bit floating-point number
Int16 – 16 bit signed integer
Int32 – 32 bit signed integer
Integer – 32 bit signed integer
Int64 – 64 bit signed integer
SByte – 8 bit signed integer
Single – 32 bit floating-point number
UInt16 – 16 bit unsigned integer
UInt32 – 32 bit unsigned integer
UInt64 – 64-bit unsigned integer
To declare a variable use:
Dim [var_name] as [type]
Dim strName as String
Dim intAge as Integer
Assigning a value to a variable
You can assign a value to a variable using the “=” sign.
Dim strLastName as string =”McDonald”