Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you assign null value to optional parameters in VB.NET 1.1

I tried DbNull.Value but no luck. How do I assign a default value as null to a string parameter that is null in VB.NET? Its litte strange to see that VB does not have anything like plain null as most of the other languages do. Also what is the difference between null and DbNull and Nothing. Thanks Guys.

like image 905
Tintin Avatar asked Nov 15 '25 03:11

Tintin


1 Answers

Nothing is what you use in VB for null, so VB has no null, and DBNull is to be used to pass null to database when, for example, you are constructing a call to stored procedure and one of its input parameters needs to be null.

like image 91
Michael Sagalovich Avatar answered Nov 17 '25 18:11

Michael Sagalovich



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!