<Runtime.CompilerServices.Extension()> _
Function Self(Of T)(ByVal x As T) As T
    Return x
End Function
With MyDataSet.Tables("SuperUsers")
  With .NewRow() 
    .Item("FirstName") = "Mario"
    .Item("LastName") = "Lanza"
    .Item("SecurityLevel") = 10
  End With
End With


Provides Self method for all classes. This is useful inside a With block (when you don't want to declare a variable which references the object you are working with) as it allows you to assign the newly instantiated object. Use this when instantiating objects to which you need a moment's reference.


Double click on the code to select all.