I am working on winforms application and trying to save data to access DB on click on a button. I am using update method ( this is not the first time I am using this), but for some reason when I am saving the data, the values save in the DB are saved wrong. Can someone help me point out what I am doing wrong or if there is error ?
string cb = "UPDATE Config SET features = @features, pricecost = @pricecost, price1 = @price1, tax = @tax, margem = @margem, price = @price, barcode = @barcode WHERE Code = @code";
cmd = new OleDbCommand(cb, con);
cmd.Parameters.Add("@features", OleDbType.VarChar).Value = txtFeatures.Text;
cmd.Parameters.Add("@price", OleDbType.VarChar).Value = txt_Price.Text;
cmd.Parameters.Add("@price1", OleDbType.VarChar).Value = txt_pricewithouttax.Text;
cmd.Parameters.Add("@margem", OleDbType.VarChar).Value = txt_margem.Text;
cmd.Parameters.Add("@pricecost", OleDbType.VarChar).Value = txt_pricecost.Text;
cmd.Parameters.Add("@tax", OleDbType.VarChar).Value = txt_tax.Text;
cmd.Parameters.Add("@barcode", OleDbType.VarChar).Value = txtBarcode.Text;
cmd.Parameters.Add("@code", OleDbType.VarChar).Value = txtCode.Text;
For example, the txt_Price.Text save in @price1 and txt_margem.Text save in @price...
What can i do to solve this?
Thanks