it might be a replica of

http://stackoverflow.com/questions/1120228/how-to-dynamically-call-a-class-method-in-internet

as well as

http://stackoverflow.com/questions/3918431/how-to-achieve-calling-a-function-dynamically-thats-right-the-function-to-be-cal

however the above two have solutions which because the solutions stated are complicated, not for any beginner i suppose.

and

both solutions contain "type" which in the code i believe is perfect for determining the category the technique goes to.

like

static void caller(String myclass, String mymethod)

    searching for

        MethodInfo methodInfo = type.GetMethod(mymethod)

        // Invoke the technique around the instance we produced above

        methodInfo.Invoke(obj, null)

    

but my primary site, only consists of one class present with all of the functions,

a database that has "function title" "func id"

supposed :- function title exactly just like that in code

i simply want to attain the following

  • obtain the string worth of function title based on the id pointed out within the text box

  • now call that function, whose title is incorporated in the string variable

problem

the methodinfo, needs the "type.GetMethod(mymethod)"

..

To be able to call a function you have to specify the kind this function is declared on. If all functions you will call are declared on the common class you could do this the next:

static void CallFunc(string mymethod)

searching for

    MethodInfo methodInfo = type.GetMethod(mymethod)

    // Invoke the technique around the instance we produced above

    methodInfo.Invoke(obj, null)



When the functions you will call are static you do not need a clear case of the kind:

static void CallFunc(string mymethod)

searching for

    MethodInfo methodInfo = type.GetMethod(mymethod)

    // Invoke the technique around the type

    methodInfo.Invoke(null, null)



I see 2 solutions:

  1. you have to map function id to real function title
  2. call type.GetMethods() to obtain listing of all techniques and select correct one