I think you need to save exactly the formula in the database, and when you want to use it, process the formula line using the replace method. you should get Variabl1, Variable2 data and use this code:
string f="Variabl1+Variable2*3.2+200"; f= System.Text.RegularExpressions.Regex.Replace(f, "Variabl1", TxBxVar1.Text); f= System.Text.RegularExpressions.Regex.Replace(f, "Variabl2", TxBxVar2.Text);
and then process f to run the formula. to run you can use
System.Text.RegularExpressions.Regex.Split(f, "+");
and use this replacement code for all the math operators you want.
Note: this is my way. but maybe there are other ways in C # that I don't know.
source share