小编Aar*_*oda的帖子

使用vb.net中的datetimepicker我可以设置自定义格式没有障碍但是不能让它在.value属性中保存该格式?

Try
    DateTimePicker1.Format = DateTimePickerFormat.Custom
    ' Display the date as "2012-10-24 21:47:09".
    DateTimePicker1.CustomFormat = "yyyy-MM-dd HH:mm:ss"

    strQuery = "INSERT INTO TimeClockInfo(IdTimeClock, First_Name, Last_Name, LogTime, In_Out) VALUES('" & AddTimeEmplyIdBox.Text & "','" & AddTimeEmplyFNBox.Text & "','" & AddTimeEmplyLNBox.Text & "','" & DateTimePicker1.Value & "','in')"

    SQLCmd = New MySqlCommand(strQuery, dbCon)

    dbCon.Open()

    SQLCmd.ExecuteNonQuery()

    dbCon.Close()
    MsgBox("TimeClock Data Added Successfully!")
Catch ex As Exception
    MsgBox("Failure!", ex.Message)
End Try
Run Code Online (Sandbox Code Playgroud)

这将返回value属性中日期和时间的原始格式?我在这做错了什么?

vb.net datetimepicker

0
推荐指数
1
解决办法
2971
查看次数

标签 统计

datetimepicker ×1

vb.net ×1