C# equivalent of the IsNull() function in SQL Server

前端 未结 10 2061
太阳男子
太阳男子 2020-12-12 21:53

In SQL Server you can use the IsNull() function to check if a value is null, and if it is, return another value. Now I am wondering if there is anything similar

10条回答
  •  無奈伤痛
    2020-12-12 22:18

    Use the Equals method:

    object value2 = null;
    Console.WriteLine(object.Equals(value2,null));
    

提交回复
热议问题