John Dwyer
John Dwyer

Reputation: 65

C# alternative data types

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

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?

Upvotes: 1

Views: 205

Answers (2)

Mark Cooper
Mark Cooper

Reputation: 6884

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

Upvotes: 1

Ala
Ala

Reputation: 1503

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

Upvotes: 1

Related Questions