What are ValueTypes In .Net Framework

Value types which Store data to directly and instances of Values store in the memory anywhere called as Stack.

There Which can be update,remove,edit and save dynamically.

There three general Value types

1) Built In ValueTypes

2) User Defined Value Types

3) Enumerations

Built In valueTypes are too useful For Example Some Built In ValueTypes are given Below

1) System.Sbye take 1 byte and range is 128+1-127

2) System.Int take 1 byte

3) System.Int16 take 2 byte

4) System.Int32 tabke 4 byte

5) System.Int64 take 8 byte

6) System.Decimal take 16 byte

7) System.Char used to store unicode characters

8) System.Boolean Used to store true/false

9) System.intPtr Used to pointer to memory address

10) System.Datetime

2) User Defined ValueTypes Which Can are same as Struct (this is also user defined datatype ) behave identical to Class

these are very useful for classes

ValueTypes have implicitly constructor When u Declare to these You have not need to Initiate to these with New Keyword.

3) Enumerations

These are used in classes to represent some values as a symbol

For Example I am giving u Practical Of enumeration How can create and use in Asp.net

Step 1: Make a New Web Site and go into Default.aspx.cs page and Define a Enumeration As given below

Step 2: Now go on Presentation layer of your Default.aspx Page and Place two Controls From toolbox one LinkButton and A Label

Step 3: now Double Click on Link Button and Write down given query As Given Below.

Now Run Your Web Site and Click on Linkbutton and You Will See Output\

Be Happy and Enjoy in Programming!!!


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s