rephrase my question that is more accurate, I try to insert a decimal from c # to sql server.
This is the click event of the button save the connection but does not do it
private void btnBunifuGuardarCargoDirecto_Click(object sender, EventArgs e)
{
try
{
SqlConnection Conn = BDComun.ObtenerConexion();
SqlCommand consulta = new SqlCommand("insert into cargoDirecto(costoUnitario) values(@costoUnitario)", Conn);
consulta.Parameters.AddWithValue(",@costoUnitario", Convert.ToDecimal(txtCostoUnitarioCargoDirecto.Text.Replace(",",".")));
consulta.ExecuteNonQuery();
}
catch (Exception ex)
{
MessageBox.Show("Error:" + ex);
}
}
It does not connect me to the bd and it does not insert, I do not know what it can be, Thanks for your time and help friends!