我试图使用c#在MySQL中将毫秒插入到datetime(6)的数据类型中.
这是我的代码:
MySqlCommand myCommand4 = new MySqlCommand("Insert into Test_OrderRecord values('" + OrderID + "','" + customerCode + "','" + customer + "','" + TelComboBox.Text + "','" + LicenseComboBox.Text + "','" +
DriverComboBox.Text + "','" + AddressComboBox.Text + "','" + LocationTypeComboBox.Text + "','" + PickupComboBox.Text + "','" + CustomerTypeLabel.Text + "','" +
Convert.ToDecimal(TotalPriceLabel.Text) + "','" + status + "','" + note + "','" + sandReceiptNo + "','" + createtiming + "','" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "')", myConnection);
myCommand4.ExecuteNonQuery();
Run Code Online (Sandbox Code Playgroud)
在createtiming与创建 …