I have an application that shows me in a textbox the value of a course enrollment:
string mensalidade = string.Format("{0:C}", Convert.ToDouble(leitura["Mensalidade"]));
cursoSelecionado.Mensalidade = mensalidade;
tb_Mensalidade.Text = Convert.ToString(cursoSelecionado.Mensalidade);
As we can see, the field displays the value of this course formatted for the currency style. However, I need to pass only the value of this course, as decimal, to my database (SQL Server).
inserirMatricula.Parameters.Add("@Mensalidade", SqlDbType.Decimal).Value = ???;
How can I do this?