none
Table-Valued Function containing methods from the code-behind.

    Question

  • Hi! Is it possible to use Table-Valued Function which use methods from code behind? I tried to call this function but during compilation I am getting error "E_CSC_USER_ROSLYNBINDER: Error when binding C# expression: The name 'USQLApplication1' does not exist in the current context".
    Saturday, April 2, 2016 12:22 AM

Answers

  • I solved the problem by adding reference to my .dll file in default database and adding code "REFERENCE ASSEMBLY [Custom Extractors]" between Begin and END statements. Is this a good idea?
    Saturday, April 2, 2016 1:27 PM
  • Hi... the current scoping rules are such that all dependencies for TVFs (and views and procedures) have to be inside the body and cannot be provided outside.

    So explicitly registering the assembly and referencing it inside the function body is the only correct way.


    Michael Rys

    Sunday, April 3, 2016 10:37 PM
    Moderator

All replies

  • I solved the problem by adding reference to my .dll file in default database and adding code "REFERENCE ASSEMBLY [Custom Extractors]" between Begin and END statements. Is this a good idea?
    Saturday, April 2, 2016 1:27 PM
  • Hi... the current scoping rules are such that all dependencies for TVFs (and views and procedures) have to be inside the body and cannot be provided outside.

    So explicitly registering the assembly and referencing it inside the function body is the only correct way.


    Michael Rys

    Sunday, April 3, 2016 10:37 PM
    Moderator