窗口里的表控件SQLtable设置好后,控件生成后列的属性也设置了dateLongTime,数据库里面设置的是datetime
直接show dt 是包含的时分秒的,就是写入列的时候没有时分秒,怎么才能向数据库里面写这个数据的时候带上时分秒
此主题相关图片如下:dt的时间.png
此主题相关图片如下:写到表里的时间.png
Tables("A080_QT站点接收界面_Table1").Fill("Select [NO],[SiteNo],[CodeNo],[CodeNo2],[ProductModel],[Quantity],[WorkOrderNo],[Condition],[Intime],[InUser],[Outtime],[OutUser],[Lock],[ClientID] Fr m {A9999} where C ","TOPNO1",False)
Tables("A080_QT站点接收界面_Table1").Cols("Intime").SetDateTimeFormat(DateTimeFormatEnum.DateLongTime)
Tables("A9999").ApplyFilter = False
Dim cmd As New SQLCommand
Dim dt As Date
cmd.C
cmd.CommandText = "Select GetDate()"
dt = cmd.ExecuteScalar()
MessageBox.show( dt )
Dim bl1 As WinForm.TextBox = e.Form.Controls("产品编号1输入框")
Dim jssl As WinForm.Label = e.Form.Controls("接收数量")
Dim bl1v As String = bl1.value
Dim jsslv As Integer = jssl.text
Dim i As Integer = jsslv
Dim cc As DataRow
Dim dd As DataRow
Dim ee As DataRow
cc = DataTables("A080_QT站点接收界面_Table1").Find("CodeNo = '"& bl1.value & "'AND Condition = 8 AND SiteNo = 'A080' ","Intime desc") '查询状态为8待收入的
dd = DataTables("A080_QT站点接收界面_Table1").Find("CodeNo = '"& bl1.value & "'AND SiteNo = 'A080' ","Intime desc") '
ee = DataTables("A080_QT站点接收界面_Table1").Find("CodeNo = '"& bl1.value & "'AND Condition = 1 AND SiteNo = 'A080' ","Intime desc")
If bl1v = ""
MessageBox.show("请输入产品编号1")
Else If dd Is Nothing Then '有查到数据
messagebox.show("无账品")
Else If dd IsNot Nothing Then
'If cc IsNot Nothing Then
MessageBox.show("未过账,请收入站点")
If ee IsNot Nothing Then
MessageBox.show("已过账")
Else
Dim dr As Row
Dim filter As String
filter = "CodeNo = '"& bl1.value & "'AND Condition = 8 AND SiteNo = 'A080' "
Tables("A080_QT站点接收界面_Table1").filter = filter
dr = Tables("A080_QT站点接收界面_Table1").Rows(0)
dr("InUser") = user.name
dr("Intime") = dt
dr("Condition") = 1
i =i+1
jssl.text = i
End If
End If
DataTables("A080_QT站点接收界面_Table1").Save()
e.Form.Controls("产品编号1输入框").Select
Tables("A080_QT站点接收界面_Table1").ApplyFilter = False