Is it possible to coalesce string and DBNull in C#?

前端 未结 10 1341
滥情空心
滥情空心 2021-01-02 06:24

I\'m writing a C# routine to call a stored proc. In the parameter list I\'m passing in, it is possible that one of the values can legally be null. So I thought I\'d use a

10条回答
  •  一向
    一向 (楼主)
    2021-01-02 06:59

    I'm pretty sure that just passing a null to the SqlParameter constructor results in it being sent as a DBNull.Value... I may be mistaken, since I use the EnterpriseLibraries for DB access, but I'm quite sure that sending a null is fine there.

提交回复
热议问题