User-Defined Types in VB.NET
4/26/2006 by ITtoolbox Popular Q&A Team
ITtoolbox as adapted from VB-dotNET-L discussion group
How does one employ User-defined types in VB.NET?
Disclaimer: Contents are not reviewed for correctness and are not endorsed or recommended by ITtoolbox or any vendor. Popular Q&A contents include summarized information from VB-dotNET-L discussion unless otherwise noted.
1.Adapted from a response by steveengland on 4/23/2006
It is usually done as structures or a class. Be careful about declaring
public/private scope of a UDT.
Public Structure somedatabase
Dim name As String
Dim address As String
Public mydatabase As somedatabase
2.Adapted from a response by John Warner on 4/23/2006
Worth noting like a class, structures can have methods. A Class is a ref
type, a structure is a val type. This too is worth noting in case you
need to watch resource consumption.
Disclaimer: Contents are not reviewed for correctness and are not endorsed or recommended by Toolbox.com or any vendor.
Popular Q&A contents include summarized information from Visual Basic .NET discussion unless otherwise noted.