Data Types in LightSwitch


Introduction

Data Type is the type of data in the programming. They have predefined characteristics. When a program stores the data in a variable then each variable must be assigned a specific type of data. Some common data type is integer, float, string etc.

Classes of data types

There are many types of classes of data types, which are as follows.

  1. Binary data type
  2. Boolean data type
  3. Numeric data type
  4. String data type
  5. Date & Time data type
  6. TimeSpan data type

Binary Data type

In the binary data type you can store any type of binary data Binary data is row data. There are many types of binary data, Which are as follows

Byte data type

  • VB Type : Byte()
  • C# Type : byte[]
  • Range : True or False
  • Remark : An array of bytes that has a variable length

Image data type

  • VB Type :  Byte()
  • C# Type : byte[]
  • Range : No
  • Remark : A Binary treated as a image

Boolean data type

There are two values in Boolean data type which are 'true' & 'false'. There are only two value possible i.e.' true' & 'false'. The Boolean data type also implement as 0 & 1.The meaning of 0 is false and 1 is true.

  • VB Type : Boolean
  • C# Type : bool
  • Range : 0 to 255

Numeric data type

There are many numeric data types in LightSwitch. Which are as follows

  1. Integer data type
  2. Float data type

Integer data type

Short Integer

  • VB Type : Short
  • C# Type : short
  • Range : -32768 to 32767
  • Remark : A signed 16-bit integer

Integer

  • VB Type : Integer
  • C# Type : int
  • Range : -32768 to 32767
  • Remark : A signed 32-bit integer

Long Integer

  • VB Type : Long
  • C# Type : long
  • Range : -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807
  • Remark : A signed 64-bit integer

Float data type

Double

  • VB Type :Double
  • C# Type : double
  • Range : +-5.0e-324 to +-1.7e+308
  • Remark : Floating decimal point with 16-16 digits precision, suitable for scientific number

Decimal

  • VB Type : Decimal
  • C# Type : decimal
  • Range : +-1.0e-28 to +-7.9e28
  • Remark : Fixed decimal point value with 28-29 significant digits, suitable for financial and monetary values, stored with specific precision and scale

Single

  • VB Type : Single
  • C# Type : float
  • Range : +-1.5e-45 to +-3.4e+38
  • Remark : Floating decimal point with 7 digits precision

Money

  • VB Type : Decimal
  • C# Type : decimal
  • Range : No
  • Remark : A Decimal treated as a monetary value
     

String data type

String is a set of characters or sequence of character. Which are typically used to represent words and text. There are three string type in LightSwitch, Which are as follows

String

  • VB Type : String
  • C# Type : string
  • Range : A sequence of zero or more Unicode characters
  • Remark : A set of character that has variable length
     

PhoneNumber

  • VB Type : String
  • C# Type : string
  • Range : No
  • Remark : A string treated as a phone number

EmailAddress

  • VB Type : String
  • C# Type : string
  • Range : No
  • Remark : A string treated as a email address
     

Date & Time data type

Date and Time data types are used for values which contain date and time.The date data type is used to specify a date and time data type is used to specify time.

  • VB Type : Date
  • C# Type : DateTime
  • Range : 00:00:00 Jan 1,0001 AD(CE) to 23:59:59 Dec 31,9999 AD(CE)

TimeSpan data type

A TimeSpan data type is a difference between the two DateTime data type.

  • VB Type : TimeSpan
  • C# Type :  TimeSpan
  • Range : 00:00:00:000000 to 23:59:59:9999999
  • Remark : A time interval in days, hours, minutes, second and fraction of second

Summary

So data type is a type of data which is used in the programming. It is very necessary for declare the variable before using it.

Up Next
    Ebook Download
    View all
    Learn
    View all