How to pass null for a parameter in stored procedu

2019-08-23 09:46发布

问题:

In C# code I have a variable Guid? name.But,how to initialize this parameter to null,since I cannot assign null for a guid type

回答1:

Set the parameter value to DBNull.Value.



回答2:

param = New SqlParameter("@GUID_ID", SqlDbType.UniqueIdentifier, 16)
param.Value = DBNull.Value


标签: nullable