Blog

Datatype conversion in C# and VB

Posted by Gomathi Palaniswamy Blogs | How do I Oct 08, 2010
Here are some classes that are used in data type conversions.

C#

In c# we can convert by casting
int y;
Datatype x = (Datatype) y;

Data types:

byte, sbyte, short, ushort, int, uint, long, ulong, float, double, decimal, char, A Unicode character, string, bool, object

Visual Basic has classes for all data type conversions. Here is a list of classes.

CBool - convert to Bool data type
CByte - convert to Byte data type
CChar - convert to Char data type
CDate - convert to Date type
CDbl - convert to Double data type
CDec - convert to Integer data type
CLng - convert to Long data type
CObj - convert to Object type
CShort - convert to Short data type
CSng - convert to Single data type
CString - convert to String data type

COMMENT USING
PREMIUM SPONSORS
Hire Mobile & Web Developer on demand. 100% satisfaction. Try for 1 week or Money Back. Local and remote developers available all over USA.
Employers - Post Free Jobs
SPONSORED BY
  • MCN is your source for developing solutions involving websites, mobile apps, cloud-computing, databases, BI, back-end services and processes and client-server applications.