Jack

Jack

  • NA
  • 4
  • 0

using the contens of a variable as a variable name

Dec 19 2008 9:34 AM
Hi,
I am trying to do something similar to this

Byte tmpvar;
string tmpvar2;
tmpvar2 = "textBox1.Text";
tmpvar = Convert.ToByte(tmpvar2); ;
           
Of course it does not accept tmpvar2 when calling Convert.ToByte() is there a way to have the contents of tmpvar2 interperted as as variable ?
I have seen the eval() command work on some scripting languages, is there something similar in C# ?

Cheers


Answers (2)