-- 作者:cnsjroom
-- 发布时间:2022/12/13 16:56:00
-- 值 '10.2961574074074' 转换成数据类型 int 时失败
错误的事件名称 System.Data.OleDb.OleDbException (0x80040E07): 在将 varchar 值 \'10.2961574074074\' 转换成数据类型 int 时失败。 在 System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior behavior, String method) 在 System.Data.OleDb.OleDbCommand.ExecuteNonQuery() 在 Foxtable.SQLCommand.ExecuteNonQuery() 2022-12-13 16:53:44
代码如下:【已借用天数 int属性】
Dim cmd As new SQLCommand cmd.Conn ecti cmd.CommandText = "sele ct guid from 办案装备_管理台账 where 当前借用时间 is not null" Dim bt As DataTable=cmd.ExecuteReader() Dim Products As List(Of String) Products = bt.GetValues("guid") For Each Product As String In Products Dim d As Date = Date.today() cmd.CommandText = "Sel ect 当前借用时间 from {办案装备_管理台账} Where guid=\'" & Product &"\'" Dim Values = cmd.ExecuteValues If Values.Count > 0 Then Dim d11 As Date = Values("当前借用时间") Dim tp As TimeSpan = d - d11 Dim bbb As Integer =tp.TotalDays output.show(bbb) cmd.CommandText = "up date 办案装备_管理台账 set 已借用天数=\'"& tp.TotalDays & "\' where guid=\'" & Product &"\'" cmd.ExecuteNonQuery() End If Next
|