bonjour,
j'ai un probleme; quand je saisie un nombre 12.3 dans textbox, il s'arrondit a 13 je veux que ca reste 12.3 mon code est le suivant:
SqlCommand command = new SqlCommand("INSER INTO [Table_test] [toto], [bobo] VALUEU (@toto @bobo)"');", connection);
command.Parameters.Add(new SqlParameter("@toto", SqlDbType.Decimal));
command.Parameters.Add(new SqlParameter("@bobo", SqlDbType.Decimal));
if (textBox_toto.Text != "")
{
command.Parameters["@toto"].Value = decimal.Parse(textBox_toto.Text, System.Globalization.CultureInfo.InvariantCulture);
}
else command.Parameters["@toto"].Value = System.DBNull.Value;
if (textBox_bobo.Text != "")
{
command.Parameters["@bobo"].Value = decimal.Parse(textBox_bobo.Text, System.Globalization.CultureInfo.InvariantCulture);
}
else command.Parameters["@bobo"].Value = System.DBNull.Value;
command.ExecuteNonQuery();
merci