int i=null is wrong? how it make corect in .net
sainath reddy
Select an image from your device to upload
Hi,
primitive types can't be null. but to reduce the impedance missmatch between database and programing languages like C# MS has come up with the nullable types.
Thanks,
Chinna
Nullable types represent value-type variables that can be assigned the value of null.
The syntax T? is shorthand for System.Nullable<T>, where T is a value type. The two forms are interchangeable.
Assign a value to a nullable type in the same way as for an ordinary value type, for example int? x = 10; or double? d = 4.108;
Use the System.Nullable.GetValueOrDefault property to return either the assigned value, or the default value for the underlying type if the value is null, for example int j = x.GetValueOrDefault();
For more information visit this link:http://msdn.microsoft.com/en-us/library/1t3y8s4s(VS.80).aspx