For those of you still jumping into VB.NET I have compiled a list of new keywords available in .NET!! These will come in handy so have a sharp pencil ready.
Below you will find quick explanations of each:
Continue: Enables you to work through loops more logically in specific situations.
For i As Integer = 0 To (s.Length() - 1)
If (s(i).Equals(" ")) Then Continue For
spaceCounter += 1
Using: The Using keyword ensures that resources get destroyed as soon as possible instead of remaining in memory until the method is executed. No more waiting for garbage collection! Note that there is no need to Dim our object.
Using conn as New SqlConnection
' use the conn object
End Using ' Automatically disposes our conn object
My: This new keyword is designed to quickly give you access to a large variety of resources you may need to access when developing your applications. Different implementations in ASP.NET and VB.NET / Winforms.
'Retrieve the computer name
Dim computername As String = My.Computer.Info.OSFullName
IsNot: The IsNot operator is the opposite of the Is operator.
If myObject1 IsNot myObject2 Then ...
TryCast: The TryCast statement attempts to cast without having to handle the invalid cast exception. If the cast is invalid a Nothing value is returned.
manager = TryCast(obj, Employee)
If manager IsNot Nothing Then
' use the manager object
And that is that! Those are some extremely useful additions to the VB.NET language. Information was referenced from Professional ASP.NET 2.0, Appendix A. For further information and descriptions I highly recommend:
Professional ASP.NET 2.0
by Bill Evjen et al.
Wrox Press © 2006 (1290 pages)