title: How to make a data table recognize functions
body: <p>I found a function online somewhere that is able to execute string equations. For example I can have a string such as "1+5". When I pass it to the function, it returns returns the answer. In my application, I am pulling formulas from a database and replacing unknown numbers (such as x, y, or z) with actual numbers (1,2,3,4,5 etc) inputed by the user when they use the application. However, some of the formulas I need to execute need square roots. When I try to pass a string that contains the Math.Sqrt() function it gives me an error saying that it is an un-definded function. Is there a way I can modify the function to recognize this function?</p>
  
  <p>The function uses a data table. Here is the code:</p>
  
  <pre><code>public static double executeFormula(string expression)
  {
      System.Data.DataTable table = new System.Data.DataTable();
      table.Columns.Add("expression", string.Empty.GetType(), expression);
      System.Data.DataRow row = table.NewRow();
      table.Rows.Add(row);
      return double.Parse((string)row["expression"]);
  }  
  </code></pre>
  
  <p>Thanks guys!</p>