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

  • SEARCH
  • Home
  • 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

Background I currently have an array like this: [1,1,2,3,4,5,5,5,6,7,8,8,8,8,9,10] I have been using a
I currently have a complete cover background image. Here is the code: #back{ /*
I currently have the following CSS (called splash.css): html { background:url(splash.jpg) center no-repeat; background-size:auto
Background Currently, I am working on a Rails application. I have different products that
I have a website that I'm making that needs a background resizer. Currently, I
I have this query which works correctly in MySQL. More background on it here
Problem background I am currently developing a framework of Ant Colony System algorithms. I
We currently have an application that starts its own background services to manage syncing
I currently have a listboxitemcontainer, which if selected turns the background blue. However later
I currently have a site that uses a two-tone background image that is centered

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.