VistaDB 5
CLR Proc Sample Basic Steps Overview

The CLR Proc Sample can be found on our tutorials site.

Basic Steps using SQL Scripts

The following steps can be taken to build just the CLR Procs assembly, and then manually load it all into the database using only Data Builder. I highly recommend you do these steps one time just to see how they are done.

  • Compile the MyClrProcExport project (just compile entire solution)
  • Load the SampleDB.VDB4 from the debug folder of the CLRProcSampleRunner.
  • Load the AddAssemblyAndProcs.vsql4 file. Run to load the assembly and assign the functions. Also demonstrates how to update an assembly using only SQL code.
  • Load the CallCLRProcs.vsql4 to see different ways of calling the functions and procedures.
  • Load the RemoveAssemblyAndProcs.vsql4 to remove all of the methods and then drop the assembly.

Basic CLR Procs Steps with C# Source

The sample source code allows you to step through and look at the code calls within Visual Studio.

  • Compile the MyClrProcExport project. Set a break point in the main of the CLRProcSampleRunner project (Program.cs).
  • Debug the CLRProcSampleRunner as the startup project.
  • Step through the following functions to each action:
  • RegistrationRoutines.RegisterAssembly();
  • RegistrationRoutines.RegisterAllMethodsDDA();
  • RegistrationRoutines.ShowRegisteredCLRMethods();
  • CallingRoutines.CallAllSQL();
  • RegistrationRoutines.UnregisterAllMethodsDDA();
  • RegistrationRoutines.UnregisterAssemblyDDA();

I think they are pretty self explanatory, and there are lots of comments in the cod
See Also