Want to become a Vibe Coder? Join Vibe Coding Training here
x
C# Corner
Tech
News
Videos
Forums
Jobs
Books
Events
More
Interviews
Live
Learn
Training
Career
Members
Blogs
Challenges
Certification
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Refer
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
How to Determine whether a type is Value type or Reference Type
WhatsApp
Gaurav Gupta
12y
12.8
k
0
2
25
Blog
You can easily check or determine, whether a type is a Value type or it is a Reference type by using the below code.
Here, I will going to check
whether
DataTable
is value type of reference type?
DataTable MyTable = new DataTable();
Type T =
MyTable
.GetType();
bool isValueType =
T
.IsValueType;
isValueType will return false.
So,
DataTable
are Reference Type.
How to Determine whether a type is Value type or Reference Type
People also reading
Membership not found