Welcome to AspAdvice Sign in | Join | Help

Browse by Tags

All Tags » Nullables   (RSS)

Using ?? and casting To Set Default Values

Often we have some value that may or may not be null, and we want to give it a default value if its null. An awesome way to do this is to use ?? (only works in C#) and add your default value, and cast the entire thing, for example as follows: string strCustomerName
Posted by salibhai | 0 Comments
Filed under: , , ,