General
Apex SQL Audit
Apex SQL Clean
Apex SQL Code
Apex SQL Diff
Apex SQL Doc
Apex SQL Edit
Apex SQL Enforce
Apex SQL Log
Apex SQL Script
Knowledgebase Home
Apex SQL Audit
Apex SQL Clean
Apex SQL Code
Apex SQL Diff
Apex SQL Doc
Apex SQL Edit
Apex SQL Enforce
Apex SQL Log
Apex SQL Script
Knowledgebase Home
|
ApexSQL Knowledgebase Tips and How-to Articles for Apex SQL Tools How to Use External Assemblies in ApexSQL Code Templates DESCRIPTION The article describes how to reference an external assembly from a template in ApexSQL Code. SOLUTION The Assemblies property in ApexSQL Code allows you to reference an external assembly from a code template. For instance, to use the MessageBox class in a template for the purpose of displaying messages, the System.Windows.Forms.dll assembly must be referenced. To add a reference to the assembly, click the Browse button in Import-Assembly of the Properties panel: ![]() In the Assemblies dialog, enter the assembly name: ![]() Important: The assembly must exist in the Global Assembly Cache (the same directory as ApexSQLCode) , or in the ApexSQLCode\bin directory. The namespace of the assembly may be defined in the Property panel: ![]() The Namespaces property is used to import a namespace so that it can easily be used on the template. In our example, if System.Windows.Forms namespace is not imported, System.Windows.Forms.MessageBox.Show() would have to be typed in the template every time we want to display a MessageBox from System.Windows.Forms.dll assembly: ![]() If the namespace is imported, above code would be simplified as below: ![]() Tip: To reference several assemblies, enter the name of each assembly into separate lines. ![]() AUTHORS William Parker Denis Mak LAST REVIEW DATE 21 August 2007 Labels: ApexSQL Code ...Welcome to the ApexSQL Knowledge Base Welcome to the ApexSQL Training Knowledge Base. Here you'll find tips, reviews, videos, and articles on how to get the most out of ApexSQL Tools and Microsoft SQL Server. Labels: Apex SQL Audit, Apex SQL Edit, Apex SQL Script, ApexSQL Clean, ApexSQL Code, ApexSQL Diff, ApexSQL Doc, ApexSQL Enforce, ApexSQL Law, ApexSQL Log, ApexSQL Report, General ... |
© 2007 Apex SQL Tools All Rights Reserved | 1.919.968.8444 | Contact Us | Terms of Use






