Boolean
The values that can be stored in boolean data can onnly be true or false. We use this data type if we expect two possible states: yes/no or true/false. The default value of boolean data is False.
Integer
Integer data can contain signed whole numbers ranging from -2,147,483,648 through 2,147,483,547. The default value for integer type data is 0. If you assign a value that is outside of this range, you will get an error message. If you would like to store the result of the calculation, then do not use integer. Integer will not show the fractions. Here are some examples of Integer data
Long
Long is another integer data type that shold be used for signed whole numbers that are larger than the integer range. The range for long data is -9,224,372,036,854,775,808 through to 9,223,372,036,854,775,807 (9.2...E+18). The default value for long data is 0. Here are some examples of long integer data.
- 1234567890998
- -123456789099
- -77898588098L
Short
The short data type is used to hold signed integer values ranging from -32,768 through to 32,767. We use this for values that do not require the whole range of the integer type. The default value for short data is 0. Here are some examples:
Decimal
The decimal type of data can hold numbers in a fixed-point format and allows fractions and decimal points. Here are some examples
Byte
This data type can contain integers ranging in value from 0 through 255. We use this data type to store binary data. Remember that the byte data type cannot contain the negative sign for the values, so if the negative sign plays a significant role in your data, other data types should be considered. The default value for byte data is 0
Double
Double data can store double-precision floating-point numbers ranging in value from -1.79769313486231570E+308 through -4.94065645841246544E-324 for negative values and from 4.94065645841246544E-324 through 1.79769313486231570E+308 for positive values. The default value for double data is 0. Here are some examples.
Object
Object data is used to hold any type of data and was introduced in the VB.NET version. The default value for object data is nothing.
String
String data may contain letters such as A-Z or a-z, numbers 0-9 and all special characters such as %,$ and #. The numbers you use as string type cannot be used in calculations unless they are converted. The default value for string is Nothing. Here are some examples for string data type
- "Mike"
- "2005"
- "$100.00"
- "Visual Basic 2008"
Char
The Char data type should be used when you plan to store one unsigned character . If only one character should be stored, using the char type instead of the string type will prevent unneeded overhead. Unicode characters refer to the 128 characters(0-127) that are found on standard U.S. keyboards. It can hold values from 0 through 65535