Execute code stored in a database field

Posted on 2007-07-31
Last Modified: 2010-04-23
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?
Question by:chlade
    LVL 96

    Accepted Solution

    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


    Author Comment

    Wow, that is a lot to look at.  Let me look through it and see if it helps.

    Author Comment

    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:

    Featured Post

    Do You Know the 4 Main Threat Actor Types?

    Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

    Join & Write a Comment

    If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
    Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
    This video discusses moving either the default database or any database to a new volume.

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now