Click here to Skip to main content
15,923,083 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi All, need your enlightenment since i was new in vb.net.
VB
'this value is a string type
varsfromDB = Dataset.Tables(0).Rows(I)("FUNC")

'this part that i did not know how to make the next line to work
varsConverted = convert.sometype(varsfromDB)

'this line is the goal
Call varsConverted()

and it was definitely end up with "expression is not a method". can somebody help me?
thank you in advance
Posted
Comments
[no name] 2-May-14 14:14pm    
You really need to describe what it is that you are trying to do. varsConverted is a variable not a method. You cannot "call" it.

This is not how you call a method dynamically.
What you do is use Reflection.

Some examples -
http://msdn.microsoft.com/en-us/library/a89hcwhh%28v=vs.110%29.aspx[^]
Invoking a method via reflection using parameter names?[^]
 
Share this answer
 
Comments
Maciej Los 2-May-14 14:28pm    
+5!
Abhinav S 2-May-14 14:31pm    
Thank you.
arauz_bluemoon 2-May-14 23:23pm    
Thank you Abhinav for your enlightenment, is there any other way to call method besides using reflection? and is it the same method like codedom?
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900