Utilising IronPython for Active Expressions.
We lately had this question posted to our forums over at LVS :
(more…)Earnest Forum Experts:
I am searching very specialised solution:
I have various Items which I store into a table in a Relational DB.
I would care to do a custom calculation, specific for each item at it’s instance. Because the calculation is specific for the item, and items are soo many I wold care to put in the calculation formula into a relational DB. The problem is to change the string of formula into a existent programming command and to really execute the calculation. I do not desire to utilise Excel or extra software in order to gather calculation speed e.g.ItemID = 5001, ItemSize = “a - b”
ItemID = 5002, ItemSize = “a - 2*b”
ItemID = 5003, ItemSize = “a + b”And then, ItemSize is in reality the formula expression that would work out assorted instances of a and b variables… I have examined this:
int a = 10;
int b = 5;stringing up formula = “a + b” // This comes from ItemSIze of DB,SQL, etc.
int Result = a + b; // This is a second line for test merely - firmly ridden…
int CalcResult = int.Parse(formula); //I care this was puzzling out…
MessageBox.Show(Result.ToString()); // This figures out…
MessageBox.Show(CalcResult.ToString()); // Ne’er conveyed that far.The result will be stored in dissimilar DB with the instances of a and b.
Could you please post any information on how should I set about this problem.Thanks a lot.
