473,394 Members | 1,737 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Storing Formulas - Database

All - I have a project that has a bunch of formulas. I would like to store
each of the formulas in a SQL and then load them and have my app execute it.
The problem I see is that a Dataset would return the formula as a string and
not as a result. Anyone have an idea on how I could accomplish this?

Example: If I wanted to store ((5+15)-9)*10 in SQL. I want to display the
answer 111 in a text box and not ((5+15)-9)*10

Thanks,
Brian
Mar 4 '06 #1
1 1739

"Brian P. Hammer" <Br*********@community.nospam> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
All - I have a project that has a bunch of formulas. I would like to
store each of the formulas in a SQL and then load them and have my app
execute it. The problem I see is that a Dataset would return the formula
as a string and not as a result. Anyone have an idea on how I could
accomplish this?

Example: If I wanted to store ((5+15)-9)*10 in SQL. I want to display the
answer 111 in a text box and not ((5+15)-9)*10


What you need is an EXEC function - a function which can treat a string as a
line of code and compute it. You could write your own interpreter but you
will not enjoy that - see "The dragon book" (Compilers: Principles,
Techniques and Tools by Alfred V. Aho, Ravi Sethi, Jeffrey D. Ullman) if you
don't believe me. You may find it easier to use an Excel spreadsheet to do
this. Another approach is a parser subroutine - see
http://www.codeproject.com/cpp/FastMathParser.asp which might work OK.

Mar 4 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Steve D | last post by:
I've looked all over but can't find a solid answer. I've got a function that runs from a View and when the function runs the first time it is calculating a Temperature for a group of Formulas. ...
5
by: Don Vaillancourt | last post by:
I'm building a system when one can upload a document to the website. I will be storing the document on the hard-drive for quick/easy access, but I was also thinking of storing it in an existing...
2
by: yzarc | last post by:
I'm working with a DB design that seems to me to be rather complex. This is a very slimmed down version of what I'm doing, but I believe it is enough to get my question resolved. Here is my...
4
by: Sehri | last post by:
Hi all, I have just started developing a math companion tool with VS2005 and I just ran into a problem when trying to add the description of a formula. Doed anyone know how can I add math...
3
by: Carlos Magalhaes | last post by:
Hey All, I am doing some excel automation using the excel COM. I can do most of the functions and its working well until I come across a formula. I can run a formula and insert the formula...
5
by: Georgess | last post by:
Hi I have a problem with a crystal reports viewer I have developed with VS.Net 2003. Everything was working fine until I tried to view reports with suppression formulas... Eg. suppress (no Drill...
6
by: Martien van Wanrooij | last post by:
Hi all, I have been looking in some forums etc. but cannot find what I would like. I need some financial formulas for a site related to some mortgage issues. Unfortunately the specifications...
11
by: rob | last post by:
I have the following scenario. A user requests some math calculations from a server. The data and a library of basic formulas reside on the server. Now the user should be able to create more...
4
by: John Brock | last post by:
I have a .NET application that, among other things, creates Excel workbooks, and I have run into a very strange problem involving formulas on one worksheet that reference values on another...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.