Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
kmt.Parameters.AddWithValue("@car_date", DateTimePicker1.Text);
car_date是一个date类型列,它的格式是yy-mm-dd
car_date
date
yy-mm-dd
但我的DateTimePicker格式是dd.mm.yy
DateTimePicker
dd.mm.yy
我怎样才能解决这个问题?
将 分配DateTimePicker.Value.Date给您的参数 - 而不是.Text字符串!
DateTimePicker.Value.Date
.Text
kmt.Parameters.AddWithValue("@car_date", DateTimePicker1.Value.Date);
这DATE是 SQL Server(假设您有 SQL Server)没有格式 - 它只是一个 8 字节的二进制数据。
DATE