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 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 C#.
In C# .net we commonly used int, string, double, char, float and bool data types.

Data types in C#
Data types in C#

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
string data types in

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 and double data types in C#.

  • Float is a 32-bit digit number.
  • Float can hold up to 7 digit number.
  • Double is a 64-bit digit number.
  • Double can have up to 16 digit number.

Float and double data types are used to store integer number which may or may not contain decimals.

float a = 12.5F;

double db = 1235.6;

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.

Related ASP.Net Topics :

Write server side code in web form.
Comment code C#

Subscribe us

If you liked this post, then please subscribe to our YouTube Channel for more video tutorials.

We hope that this tutorial helped you to understand about data types in C#.

Next, tutorial we will understand about C# Variable.

Leave a Reply

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