Free Resources from FMS

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.

 

Free Catalog

 

Simplify Namespace Usage

Provided by:  FMS Development Team

Overview

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");

}

More Information

Return to the tips page