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 3800766
In Process

The Archive Base Latest Questions

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

I am playing around with learning MVC and want to create a recipe recorder

  • 0

I am playing around with learning MVC and want to create a recipe recorder application to store my recipes.

I am using .net with Sql Server 2008 R2 however I don’t think that really matters with what I am trying to do.

I want to be able to record all of the measures I use. In my country we use metric however I want people to be able to use imperial with my application.

How do I structure my table to cope with the differences, I was thinking of storing all of the measurements as ints and have a foreign key to store the kind of weight.

Ideally I would like to be able to share the recipes between people and display the measurements in their preferred way.

Is this the right kind of way

IngredientID PK
Weight int
TypeOfWeight int e.g. tsp=1,tbl=2,kilogram=3,pound=4,litre=5,ounce=6 etc
UserID int 

Or is this way off track? Any suggestions would be great!

  • 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:56:41+00:00Added an answer on May 19, 2026 at 1:56 pm

    If you are storing weights (a non-discrete value) I would strongly suggest using numeric or decimal for this data. You have the right idea with the typeofweight column. Store a reference table somewhere showing what the conversion ratio is for each (to a certain standard).

    This gets quite tricky when you want to show ounces as TSP, because the conversion depends on the ingredient itself, so you need a 3rd table – ingredient: id, name, volume-to-weight ratio.

    Example typeofweight table, where the standard unit is grams

    type   | conversion
    gram   | 1
    ounce  | 28.35
    kg     | 1000
    tsp    | 5            // assuming that 1 tsp = 5 grams of water
    pound  | 453.59
    

    Example ingredient volume to weight conversion

    type   | vol-to-weight
    water  | 1
    sugar  | 1.4          // i.e. 1 tsp holds 5g of water, but 7g of sugar
    

    So to display 500 ounces of sugar in tsp, you would use the formula

      units x ounce.conversion x sugar.vol-to-weight
    = 500   x 28.35            x 1.4
    

    Another example with 2 weights

    Ingredient is specified as 3 ounces of starch.  Show in grams
    = 3 x 28.35    (straightforward isn't it)
    

    or

    Ingredient is specified as 3 ounces of starch.  Show in pounds
    = 3 * 28.35 / 453.59
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm playing around and learning to use Microsoft SQL Server. I want to store
I recently just started learning .NET, and more specifically I've been playing around with
I am learning Hibernate and playing around with it using Eclipse Helios as IDE,
I am playing around, learning CoreData and when I got a test application with
I'm learning ASP.net and I've been playing around with themes and master pages. I
I am currently learning about basic networking in java. I have been playing around
Playing around with MongoDB and NoRM in .NET. Thing that confused me - there
I playing around with the Twitter API for my BlackBerry application. Is there any
I'm still learning python and after playing around with pygame I noticed I'm re-importing
I was playing around with creating a database abstraction class for learning purposes where

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.