1

I was given SQL sever database to rebuild a website for someone it has these data types:

  • money
  • bit

I am currently creating an MVC model and the data types are not recognized in MVC

   public class Beds
    {

        public int BedID { get; set; }    
        public Bit  Private { get; set; }  <------not recognized
        public Money OccupiedRate { get; set; }  <------not recognized
        public Bit HoldingRate { get; set; }    <------not recognized

    }

What are the best alternative datatypes in MVC?

Mark Cooper
  • 6,738
  • 5
  • 54
  • 92
John Dwyer
  • 65
  • 1
  • 9

2 Answers2

1

Use (Boolean) instead of (Bit) and use (Decimal) instead of (Money). see

Pரதீப்
  • 91,748
  • 19
  • 131
  • 172
Ala
  • 1,505
  • 1
  • 20
  • 36
1

Your datatype mappings are dependent on the language (C#), not the framework (MVC).

In your case the mappings are:

  • Bit is Boolean
  • Money is Decimal

For a full list of conversion types see this list on MSDN. The C# column is headed .NET Framework type

Mark Cooper
  • 6,738
  • 5
  • 54
  • 92