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?
chladeAsked:
Who is Participating?
 
Bob LearnedConnect With a Mentor Commented:
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
http://www.codeproject.com/dotnet/CompilingWithCodeDom.asp

Bob
0
 
chladeAuthor Commented:
Wow, that is a lot to look at.  Let me look through it and see if it helps.
0
 
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.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.