Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3800624
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T13:55:20+00:00 2026-05-19T13:55:20+00:00

Background We currently have an excel-based system for the creation of specifications for a

  • 0

Background

We currently have an excel-based system for the creation of specifications for a sound and lighting rental company.

Part of this is a column in the excel sheet called ‘autospec’, which is made up of Excel formulas for individual stock items ( e.g., you specify a loudspeaker, and then the formulas in the autospec column calculate the cables you need and add them onto the specification automatically.

sample formula

10m microphone cable might have a formula like the following:

=IF([loudspeakers]>0,[loudspeakers]*2,0)+([mixing desk]*4)

We’re now moving over to a proper database with a C# front end.

Question

What I would like is to be able to store the autospec formulas for each stock item in a table, and when the user specs an item the front end, the program should find the relevant formula, execute it, and change the spec quantity as appropriate.

Bottom line: I need to execute code contained within a string.

Am I going about this the wrong way?
Is there a better way?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T13:55:21+00:00Added an answer on May 19, 2026 at 1:55 pm

    I asked a similar question once: How can I evaluate a C# expression dynamically?

    You could probably use that to evaluate those expressions. This not really a safe thing to do, unless you can guarantee nobody will be adding junk (read: evil code) to your database.

    If you can break down the formulas into “families”, such that each entry in your formula column is a member of a small (5-10) set of formulas with just different parameters, you could try something like this:

    [ItemTable]<-[ItemFormulaParameters(param1, param2, param3)]->[FormulaTable(name)]
    

    And have a factory method for instantiating the formula objects by name. Each such formula object has a “calculate(param1, param2, param3)” property…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Some background. Currently have an asp.net web site which is contained on 2 web
I don't have very much background regarding COM nor coclasses, so I don't quite
I currently have a UI built in Interface Builder-- it is basically consisted of
I currently have a Form with all the desired effects except one. The current
We currently have some php code that allows an end user to update records
I currently have an issue where Firefox is taking away 1-2 pixels of padding
I currently have a Richfaces dataTable bound to a backing bean that contains all
I everyone. I currently have a problem with my focus when using a splash
Problem Shared state is in certain cases a bad thing. I am in a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.