MethodInfo.Invoke urgent help please
-
Hi all, when i am executing the following code the, if the function invoked returning other than null, it is working fine. if it returns null, then it throws the object reference not found exception. please help. string functionName ="GetMRN"; System.Reflection.MethodInfo methodinfo; methodinfo = this.GetType().GetMethod(functionName); objParamArr[0] = Param2; objParamArr[1]=param2; string strResult = methodinfo.Invoke(Invoke(this,objParamArr).ToString(); regards. HAsan Contact him at: hasansheik@hotmail.com hasansheik@yahoo.co.in hasansheik@lycos.com
-
Hi all, when i am executing the following code the, if the function invoked returning other than null, it is working fine. if it returns null, then it throws the object reference not found exception. please help. string functionName ="GetMRN"; System.Reflection.MethodInfo methodinfo; methodinfo = this.GetType().GetMethod(functionName); objParamArr[0] = Param2; objParamArr[1]=param2; string strResult = methodinfo.Invoke(Invoke(this,objParamArr).ToString(); regards. HAsan Contact him at: hasansheik@hotmail.com hasansheik@yahoo.co.in hasansheik@lycos.com
hasansheik wrote: string strResult = methodinfo.Invoke(Invoke(this,objParamArr).ToString();
object result = methodinfo.Invoke(Invoke(this,objParamArr);
string strresult = (result == null) ? "NULL" : result.ToString();xacc-ide 0.0.15 now with C#, MSIL, C, XML, ASP.NET, Nemerle, MyXaml and HLSL coloring - Screenshots