string expression = "2+1-(3*2)+8/2";
DataTable dataTable = new DataTable();
dataTable.Columns.Add("col1", typeof(int), expression);
dataTable.Rows.Add(new object[] { });
Console.WriteLine(dataTable.Rows[0][0]);
using
System;
Microsoft.JScript;
Microsoft.JScript.Vsa;
namespace
VPDBUtils
{
public
class
JScriptEvaluator
private
static
VsaEngine vsaEngine;
void
Initialize()
vsaEngine = VsaEngine.CreateEngine();
}
Close()
if
(vsaEngine !=
null
)
vsaEngine.Close();
object
EvaluateString(
string
sStringToEvaluate)
return
Eval.JScriptEvaluate(sStringToEvaluate, vsaEngine);
internal
double
EvaluateStringAsDouble(
System.Convert.ToDouble(EvaluateString(sStringToEv aluate));
object value = new DataTable().Compute(testStr, null);
3. Display the result in Label
lbl1.Text = Convert.ToString(value); Output : 773 It is actually possible with the .NET framework: object value = new DataTable().Compute(teststr, null); This is the Line which peform the Mathematical operation Check it out and let me know