Academic Tutorials



English | French | Portugese | German | Italian
Google

Home Source Codes E-Books Downloads Contact Us About Us

C# : C Sharp
Introduction to .NET
An Introduction To The .NET Framework
System Requirements
Application Types in C#
To Begin With C# Programming
.NET Type
Predefined Reference Types
Data types in C# and .NET
Classes and Object Model in .NET
Property in C# class
Arrays
Method Overloading
C# Tutorial Namespaces
Interfaces
Delegates in C#
Events in C#
Reflection
Exception Handling

HTML Tutorials
HTML Tutorial
XHTML Tutorial
CSS Tutorial
TCP/IP Tutorial
XML Tutorials
XML Tutorial
XSL Tutorial
XSLT Tutorial
DTD Tutorial
Schema Tutorial
XForms Tutorial
XSL-FO Tutorial
XML DOM Tutorial
XLink Tutorial
XQuery Tutorial
XPath Tutorial
XPointer Tutorial
RDF Tutorial
SOAP Tutorial
WSDL Tutorial
RSS Tutorial
WAP Tutorial
Web Services Tutorial
Browser Scripting
JavaScript Tutorial
VBScript Tutorial
AJAX Tutorial
DHTML Tutorial
HTML DOM Tutorial
WMLScript Tutorial
E4X Tutorial
Server Scripting
ASP Tutorial
PHP Tutorial
PERL Tutorial
SQL Tutorial
ADO Tutorial
.NET (dotnet)
Microsoft.Net
XML Web Services
ASP.Net
.Net Mobile
C# : C Sharp
ADO.NET
VB.NET
Multimedia
SVG Tutorial
Flash Tutorial
Media Tutorial
SMIL Tutorial
Web Building
Web Browsers
Web Hosting
W3C Tutorial
Web Building
Web Quality
Web Semantic
Web Careers
Java Tutorials
Java Tutorial
JSP Tutorial
Servlets Tutorial
Struts Tutorial
EJB Tutorial
JMS Tutorial
JMX Tutorial
Programming Langauges
C Tutorial
C++ Tutorial
Visual Basic Tutorial
Data Structures Using C
Soft Skills
Communication Skills
Time Management
Project Management
Team Work
Leadership Skills
Corporate Communication
Negotiation Skills


Data types in C# and .NET

Previous Next



Data types in C# and .NET

Data Types are the basic building block of any language. Microsoft has tried to standardise the data types in .NET framework by introducing a limited, fixed set of types that can be used to represent almost anything in programming world.

C++ was very rich in data types, but that leads to confusion too. Especially, when we write components that may be consumed by applications written in other platforms, we have to make sure the types used are compatible with other platforms too!

NET types start from a clean slate. All .NET languages share the same types. So, they are all compatible and no worries. This means, we can call C# code from VB.NET and vice versa, without worrying about type conversions.

NET data types are either structures or classes, part of the System namespace. For example, the following data types are implemented as struct in .NET:

  • Int16
  • Int32
  • Double

  • (String is implemented as a class in .NET.)
    If you are not very familiar with struct and class, don't worry about it. We can just use them as if they are simple data types.

    Here is how we can declare variables of type Int, Double and String:

  • Int16 age, employee Number;
  • Double salary;
  • String name, address;

  • we can use any of the .NET data types directly in any .NET language - in C#, VB.NET or xyz. NET. But in addition to the .NET types, each language provides a set of primitive types, which map to the corresponding types in .NET class library. This is why we may see some people use string and some others use String. There is no big difference. string is a primitive data type in C# and String is the corresponding class in .NET class library. The string in C# is mapped to the class in .NET class library. So, whether we use string or String, there is no real difference.




    Data Types in C# and the corresponding class/struct in .NET class library

    The following list shows the list of data types available in C# and their corresponding class/struct in .NET class library.

     

    C# Data type

     

    Mapped to .NET class/struct

     

    sbyte

     

    System.SByte

     

    byte

     

    System.Byte

     

    char

     

    System.Char

     

    float

     

    System.Single

     

    decimal

     

    System.Decimal

     

    double

     

    System.Double

     

    ushort

     

    System.UInt16

     

    short

     

    System.Int16

     

    uint

     

    System.UInt32

     

    int

     

    System.Int32

     

    ulong

     

    System.UInt64

     

    long

     

    System.Int64

     

    bool

     

    System.Boolean

     

    string

     

    System.String

     

    object

     

    System.Object




    Share And Enjoy:These icons link to social bookmarking sites where readers can share and discover new web pages.
    • blinkbits
    • BlinkList
    • blogmarks
    • co.mments
    • connotea
    • del.icio.us
    • De.lirio.us
    • digg
    • Fark
    • feedmelinks
    • Furl
    • LinkaGoGo
    • Ma.gnolia
    • NewsVine
    • Netvouz
    • RawSugar
    • Reddit
    • scuttle
    • Shadows
    • Simpy
    • Smarking
    • Spurl
    • TailRank
    • Wists
    • YahooMyWeb

    Previous Next

    Keywords Data types in C# and .NET, system c#, c# c++, c# component, c# dotnet, vb c#, c# example, convert c#, visual c#, data method, data controls, value data, c# control, vb data, c# application, c# sample, system data, data form, c# form, csharp c#, custom c#, use c#, format data, c# create


    HTML Quizes
    HTML Quiz
    XHTML Quiz
    CSS Quiz
    TCP/IP Quiz
    XML Quizes
    XML Quiz
    XSL Quiz
    XSLT Quiz
    DTD Quiz
    Schema Quiz
    XForms Quiz
    XSL-FO Quiz
    XML DOM Quiz
    XLink Quiz
    XQuery Quiz
    XPath Quiz
    XPointer Quiz
    RDF Quiz
    SOAP Quiz
    WSDL Quiz
    RSS Quiz
    WAP Quiz
    Web Services Quiz
    Browser Scripting Quizes
    JavaScript Quiz
    VBScript Quiz
    AJAX Quiz
    DHTML Quiz
    HTML DOM Quiz
    WMLScript Quiz
    E4X Quiz
    Server Scripting Quizes
    ASP Quiz
    PHP Quiz
    PERL Quiz
    SQL Quiz
    ADO Quiz
    .NET (dotnet) Quizes
    Microsoft.Net Quiz
    XML Web Services Quiz
    ASP.Net Quiz
    .Net Mobile Quiz
    C# : C Sharp Quiz
    ADO.NET Quiz
    VB.NET Quiz
    Multimedia Quizes
    SVG Quiz
    Flash Quiz
    Media Quiz
    SMIL Quiz
    Web Building  Quizes
    Web Browsers Quiz
    Web Hosting Quiz
    W3C Quiz
    Web Building Quiz
    Web Quality Quiz
    Web Semantic Quiz
    Web Careers Quiz
    Java Quizes
    Java Quiz
    JSP Quiz
    Servlets Quiz
    Struts Quiz
    EJB Quiz
    JMS Quiz
    JMX Quiz
    Programming Langauges Quizes
    C Quiz
    C++ Quiz
    Visual Basic Quiz
    Data Structures Using C Quiz
    Soft Skills Quizes
    Communication Skills Quiz
    Time Management Quiz
    Project Management Quiz
    Team Work Quiz
    Leadership Skills Quiz
    Corporate Communication Quiz
    Negotiation Skills Quiz

    Privacy Policy
    Copyright © 2003-2008 Vyom Technosoft Pvt. Ltd., All Rights Reserved.