Simplify Namespace Usage

Provided by the FMS Development Team

Namespaces in .NET can be very long and less obvious. There is a way to simplify this by creating your own alias for the namespace.

Example

You can use the Imports statement (VB.NET) or using directive (C#) with an assignment operation.

' VB

Imports OldVB = Microsoft.VisualBasic

 

// C#

Using OldVB = Microsoft.VisualBasic;

That way, you can refer to specific class elements within the class referred to using the variable you created in the assignment operation.

             ' VB

Sub Test()

OldVB.MsgBox("asdfsad")

End Sub

 

// C#

void Test()

{

      OldVB.MsgBox(“asdfsad");

}


Additional Resources

 

 

Thank you! Thank you! I just finished reading this document, which was part of a link in the recent Buzz newsletter. I have printed it for others to read, especially those skeptical on the powers of Access and its capabilities.

Darren D.


View all FMS products for Microsoft Access All Our Microsoft Access Products

 

 

Free Product Catalog from FMS