Problem when storing decimal values in SQL Server

3

I have a decimal field (18, 3) and in the application I use a JavaScript plugin to format the values entered, so I pass the value so pro SQL Server 45,000,000,000, when I look at what was registered was this 45000000000.000, or I mean, he put 3 more zeros, he means as if I had not passed the values of the decimal places. I already tried to make the mascara in the American standard, and in the Brazilian standard.

What would be the best way to solve this? How do you do in this situation?

--- Edited ---

I'm using entity framework, this is the code in Model

[Required(ErrorMessage = "Campo obrigatório!")]
public decimal VlrObra { get; set; }

Code in the data access class

public void Salvar(Obra obra)
{
    db.Obra.Add(obra);
    db.SaveChanges();
}
    
asked by anonymous 26.11.2014 / 17:29

1 answer

2

Make sure your Web.config has the following statement:

<system.web>
    <globalization culture="pt-BR" uiCulture="pt-BR" />
    ...
</system.web>
    
26.11.2014 / 19:53