How to pass null for a parameter in stored procedure - the parameter is uniqueidentifier

☆樱花仙子☆ 提交于 2019-12-11 15:43:07

问题


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


来源:https://stackoverflow.com/questions/2490514/how-to-pass-null-for-a-parameter-in-stored-procedure-the-parameter-is-uniqueid

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!