When somebody wants to get calculated result for an input string such as “(2+2)*2+2” what you will do? The normal developers will think about writing a parser ,expression evaluator etc…because they think that, this is not possible using existing APIs and they also take this as an opportunity to write their own parser.
Even I was also thinking about the same until I found the support in .Net DataColumn.There is one overload in the DataColumn constructor which accepts the expression and fills the value in all the datarows when they are being added into DataTable.
You may catch the exception if the syntax is wrong in the given expression.
See the application in action below