Data types in ASP.Net C#



Data Types in .Net

Data types are play most importance role in any programming language. Data types are used in all programming language.

A Variable must be declared with the data type. We need to inform the compiler about which types of data should be stored in a variable at the time of variable declaration.

We will learn about variable in next asp.net tutorials. In variable which types of data can be store it depend on data types of variable.

We will see some importance data types which is used frequently in asp.net C#.
In C# .net we commonly used int, string, double, char, float and bool data types.


Integer Data types in C#

For integer we use int in C#. The data should be number or digit. When we are working with digit or number the int is most commonly used data types.
All data types have it’s range to store data.

int a=10;

int data types in c# .net

int data types in c# .net


String Data types in C#.

String is declared as small string in C#. The string data types store the text value, a number of character.
String variable store data with in double quote.

string strname=”Hello Meera”;

 string data types in c#.net

string data types in c#.net


Char data types in C#.

Char are use to store a single character. We can store more character if we assign size while declaring char variable.

char abc = ‘A’;


float data types in C#.

float data types are used to store digit and number which may or may not contain decimals.

float a = 125;


Bool data types in C#.

bool data types have two values either True or False.


Data types are classified as value type or reference type. It depending on a variable store its on data or a pointer to the data in memory.

We will learn about variable in our next C# tutorial.

Leave a Reply

Your email address will not be published. Required fields are marked *

Captcha *