DotNet Academy of Rajesh Rolen

Solutions by Rajesh Rolen

Optional Nullable Parameter introduced in VB.NET 10

In previous editions like .net framework 2.0/3.0/3.5 we were not able to create a Optional parameter as a nullable in vb.net. but now its time to get happy. you can create Nullable Optional Parameter in VB.NET 10.

eg:

Sub MyFunc(ByVal _name As String, ByVal _email As String, Optional ByVal _age As Integer? = Nothing)
your code
end sub



Benefit: The benefit of Nullable Optional Parameter is that if you want to pass value then it will take value if you will not pass value then it will take 'Nothing' in that parameter then before using that parameter you can easily check that value is Nothing or not

like:

if _age isnot Nothing then
your code
end if

0 comments:

Post a Comment

About this blog

Blog Archive

My Blog List

Advertise On This Site

Site Info

Advertise on this Site

To advertise on this site please mail on RajeshRolen@gmail.com

Information Source

About

Pages

Dot Net Academy

Advertis in This Area of Site

Powered by Blogger.

Followers

Blog Archive

Search This Blog