473,769 Members | 3,232 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1757

"Brian P. Hammer" <Br*********@co mmunity.nospam> wrote in message
news:%2******** ********@tk2msf tngp13.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
2564
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. What I want to do is calculate this temperature in the UDF on the first pass and store it somewhere (table, global variable etc.). On every execution after that I'd like to use the value stored so I don't have to recalculate the value again for...
5
2146
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 database since most of the sites information is all stored there. As well there would be only one place to worry about backing up. And if the file on the hard-drive was ever missing or became corrupted, I could restore it form tha database. Is...
2
4605
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 layout. These 4 tables are used to generate a questionaire. Survey OrderID
4
2246
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 formulas and math characters in .NET? Maybe this is the same for everywhere, I just don't know the answer. I appreciate your help. Thanks, Sehri
3
2806
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 value into a cell. BUT this is where it comes "complex".
5
8429
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 Down) group header 3 when: DrillDownGroupLevel < this formula should return True or false and work fine when I run it in crystal report v9 but with the viewer I get the error message "Error in File ReportPath\ReportName.rp Error in formula...
6
3004
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 have been supplied to me be an excel sheet so it is quite tricky to find out how the formulas that are used have been made. To give some examples: I would need a formula for the future value of savings after x years when you have already an amount...
11
1685
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 complex formulas based on the basic built in formulas as well as other complex formulas that the user created himself. These formulas will be either stored on the server or client and will be applied to the data on the server. Some of the formulas will...
4
1785
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 worksheet. The text I write into, let's say, cell A25 on Sheet1 (using .NET) looks something like this: =VLOOKUP(RC,'Sheet2'!A:X,6,FALSE) On the completed workbook this turns into:
0
9590
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9424
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10051
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10000
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9866
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6675
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5448
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3968
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3571
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.