[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 181
  • Last Modified:

Execute code stored in a database field

Is there a way to execute code that is not embedded in the program?

For instance, let's say I have the following stored in a database field:

    Function AdjustStringValue(ByVal str As String) As String
        str &= "AAA"
        str &= "BBB"
        Return str
    End Function

Can I somehow call this function from a program passing it the parameter?
  • 2
1 Solution
Bob LearnedCommented:
This article is a little bit of overkill for what you need, but it highlights using the CodeDom to dynamically compile code.  

Compiling with CodeDom

chladeAuthor Commented:
Wow, that is a lot to look at.  Let me look through it and see if it helps.
chladeAuthor Commented:
There was just too much there to sift through.  But I googled a few keywords I found and after a few hours of searching and playing found a good solution.  For others that run across this question, I found a more concise example here: http://msdn2.microsoft.com/en-us/library/microsoft.visualbasic.vbcodeprovider.aspx.

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now