【发布时间】:2015-03-07 16:43:29
【问题描述】:
嗨,我试图将 vb.net 中的日期插入我的 sql 数据库,结果一直显示为 00-00-00 我使用日期时间选择器来获取格式化为短格式的日期
Public Sub NewAppointment()
SQLCommand.Connection = SQLconnection
SQLCommand.CommandText = "INSERT INTO " & _
appointment(TattooID,Date,Time,Length,Deposit,Cost) VALUES"& _
('" & _Tattoo.ID & "','"& _
" & AppDate.Date & "','" & _
" & AppTime & "','" & _
" & AppLength.ToString & "','" & _
" & AppDespoit & "','" & AppCost & "');"
SQLCommand.CommandType = CommandType.TableDirect
Try
SQLconnection.Open()
SQLCommand.ExecuteNonQuery()
SQLconnection.Close()
Catch ex As Exception
MsgBox(ex.Message)
End Try
SQLconnection.Dispose()
结束子
【问题讨论】:
标签: mysql database vb.net datetime