VB.NET ASPNET Type Conversion Function Examples


Premium (Not Free) Video Tutorials

Free Video Tutorials & Free Tools


VB.NET ASPNET Type Conversion Function Examples

Purpose: – Illustrates for .


VB.NET ASPNET Type Conversion Function Examples

Type Type Conversion FunctionsInput ExpressionResult
CBool(expression)Char, Numeric, or StringBoolean
Data
Type
CByte(expression)0 to 255 unsigned (gets rounded)Byte
Data
Type
CChar(expression)Char or String (if string, only first character is used)Char
Data
Type
CDate(expression)Date and/or time in any valid format.Date
Data
Type
CDbl(expression)-1.79769313486231570E+308 through -4.94065645841246544E-324 for negative values;4.94065645841246544E-324 through 1.79769313486231570E+308 for positive values.Double
Data
Type
CDec(expression)+/-79,228,162,514,264,337,593,543,950,335 for zero-scaled numbers, that is, numbers with no decimal places. For numbers with 28 decimal places, the range is +/-7.9228162514264337593543950335. The smallest possible non-zero number is 0.0000000000000000000000000001 (+/-1E-28).Decimal
Data
Type
CInt(expression)-2,147,483,648 through 2,147,483,647; fractional parts are rounded .Integer
Data
Type
CLng(expression)-9,223,372,036,854,775,808 through 9,223,372,036,854,775,807; fractional parts are rounded.Long
Data
Type
CObj(expression)Any valid data type.Object
Data
Type
CSByte(expression)-128 through 127; fractional parts are rounded.SByte
Data
Type
CShort(expression)-32,768 through 32,767; fractional parts are roundedShort
Data
Type
CSng(expression)-3.402823E+38 through -1.401298E-45 for negative values; 1.401298E-45 through 3.402823E+38 for positive valuesSingle
Data
Type
CStr(expression)1. If boolean, returns string "True" or "False" 2. If date, returns A string containing a date value (date and time) in the short date format of your system 3. If number, returns a string representing the numberString
Data
Type
CUInt(expression)0 to 4,294,967,295 – will throw exception if negative number is passed in. Rounds fractions to whole numbersUInteger
Data
Type
CULng(expression)0 to 18,446,744,073,709,551,615 (unsigned) – will throw Exception if negative number is passed in. Rounds fractions to whole numbersULong
Data
Type
CUShort(expression)0 to 65,535 (unsigned) – will throw Exception if negative number is passed in. Rounds fractions to whole numbersSByte
UShort
Type

 

Related posts:

  1. C-Sharp ASPNET Type Conversion Function Examples C-Sharp ASPNET Type Conversion Function Examples...
  2. VB.NET Console Conversion Function Examples VB.NET Console Conversion Function Examples...
  3. VB.NET ASPNET Math Function Examples VB.NET ASPNET Math Function Examples...
  4. C-Sharp ASP.NET Math Function Examples C-Sharp ASP.NET Math Function Examples...
  5. VB.NET Console Math Function Examples VB.NET Console Math Function Examples...

Related posts brought to you by Yet Another Related Posts Plugin.

Speak Your Mind

Tell us what you're thinking...
and oh, if you want a pic to show with your comment, go get a gravatar!

Powered by WP Hashcash

This blog uses the cross-linker plugin developed by Web-Developers.Net