Clr procedure to load dll assembly using Reflection

  • Hi,

    I'm trying to load an assembly in order to instantiate a class and execute a method that returns a data table.

    Assembly file (*.dll) resides on a local drive (d:\temp\my.dll)

    I managed to load the assembly and perform the operation but for some reason i keep getting an error indicating Assembly.Load(..) fails

    Code fragment

    string dll_path = @"D:\temp\my.dll";

    var assName = AssemblyName.GetAssemblyName(dll_path);

    Assembly *** = Assembly.Load(assName.FullName);

    object o = Activator.CreateInstance(..)

    ...

    Error:

    Could not load file or assembly 'My, Version=1.0.2.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.

    Is there a way to use Reflection from within Clr stored procedure?

    thanks

    Michael

  • You'll need to register that external assembly with SQL Server first.

    I'm no expert in this, but perhaps this link will help you.


  • Thanks

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply