Hi all,
In java, if a field is Integer type, we can assign it to null indicating
that this field has not been set yet. How can we achieve that in C#? In C#,
"int" is struct, we cannot set it to null. Thank you
zlf
Martin Z - 17 Nov 2006 15:46 GMT
If you're using version 2.0, google "Nullable Types". And int is not
exactly a struct, it's a value-type, where structs are also
value-types.
> Hi all,
>
[quoted text clipped - 3 lines]
>
> zlf
zlf - 17 Nov 2006 15:55 GMT
Ciaran O''Donnell - 17 Nov 2006 16:03 GMT
If your not in .NET 2, I used to use int.minvalue as null equivilent.
It does need converting to put it in a db though.
Ciaran O'Donnell
> Hi all,
>
[quoted text clipped - 3 lines]
>
> zlf