Can you set an Integer to be null in C# 2.0?
Can you set an Integer to be null in C# 开发者_JAVA技巧2.0?
I am assuming you are using c# 2.0 & .net framework 2.0 onwards.
Use nullable types for that.
e.g. int? myValue = null
;
or
Nullable<int> myOtherValue = null;
EDIT: See an example here.
精彩评论