你能帮助我吗,我想输入“0.20”作为我的费率,但它一直显示“0.00”,顺便说一句,我的数据库是MS SQL。这是我的代码
string tempDiscRate = disRateTxt.Text.Trim();
string addquery = "INSERT INTO PROD_DISCOUNT (PROD_DISC_RATE) VALUES
('" + Convert.ToDouble(tempDiscRate) + "')";
cmd = new SqlCommand(addquery, conn);
cmd.ExecuteNonQuery();
//ON FORM_LOAD
dscDgv.Columns[4].DefaultCellStyle.Format = "N2";
dscDgv.Columns[4].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;