1
I’m having a problem inserting a die of a maskedTextBox
in the Mysql database.
Follow the error
Incorrect decimal value: ' for column 'Value' at Row 1
The code is this:
conexao.Open();
MySqlCommand cmd = new MySqlCommand();
cmd.Connection = conexao;
cmd.CommandText = "insert into produto(ProdutoID, ProdutoDescricao, Valor) values (@ProdutoID, @ProdutoDescricao, @Valor)";
cmd.Parameters.AddWithValue("ProdutoID", tb_CodigoProduto.Text.Trim());
cmd.Parameters.AddWithValue("ProdutoDescricao", tb_DescricaoProduto.Text.Trim());
cmd.Parameters.AddWithValue("Valor",mkd_ValorProduto.Text.Trim());
int valorRetorno = cmd.ExecuteNonQuery();
mkd_ValorProduto
is empty.– Havenard
It’s not, I took the amount, but it’s in real for example, it’s 123.89
– Rayanne Borges
Did the answer solve your question? Do you think you can accept it? See [tour] if you don’t know how you do it. This would help a lot to indicate that the solution was useful for you. You can also vote on any question or answer you find useful on the entire site (when you have 15 points).
– Maniero