Convert string contents into line of code?

  • Thread starter Thread starter BH
  • Start date Start date
B

BH

Hi all

does C# have some way to turn a string's contents ( from a db or whatever )
into an executable line of code?

int myValue = 0;
string lineOfCode = "myValue = 20;"
//somehow 'execute' the statement in the string....
lineOfCode.ExecuteMe(); //?? is this sort of thing possible ??
//myValue is now equal to 20

Thanks...
 
Back
Top