operators as strings
<p>I need to evaluate a mathmatical expression that is presented to me as a string in C#.  Example noddy but gets the point across that the string as the expression.</p>

<p>I need the evaluate to then populate an int.</p>

<p>There is no Eval() in C# like in others langugaes...</p>

<pre><code>String myString = "3*4";
</code></pre>

<p>Edit:</p>

<p>I am on VS2008 </p>

<p>Tried the Microsoft.JScript. = Its deprecated method (but still complies - warning)</p>

<p>However the Microsoft.JScript dll that I have doens work on </p>

<blockquote>
  <p>public object InvokeMember(string
  name, BindingFlags invokeAttr, Binder
  binder, object target, object[] args);</p>
</blockquote>

<p>Complains that there is a missing ";"  go figure...</p>

<p>EDIT 2</p>

<p>Solution - was the codeDom one - it worked for as there are no security issue - only me ever going to be running the code.  Many thanks for the replies ...</p>

<p>And the link to the new Dragon Book  awesome </p>

<p>EDIT 3</p>

<p>Matt dataTable.Compute() also works - even better for the security conscious.  (parameter checking noted)</p>
