How to assign NULL to optional parameters in VB.NET 1.1

I tried DbNull.Value but no luck. How to set a default value as null for a string parameter that is null in VB.NET? It is strange to see that VB has nothing like zero, as most other languages ​​do. Also what is the difference between null and DbNull and Nothing. Thanks guys.

+3
source share
3 answers

Nothing- this is what you use in VB for null, so VB does not null, but is DBNullused to transfer nullto the database when, for example, you create a call for a stored procedure and one of its input parameters must be zero.

+4
source

use nothinginsteadnull

+1
source

VB.Net null - Nothing.

, # null, # default(T). , , .

+1

Source: https://habr.com/ru/post/1781479/


All Articles