Foxtable(狐表)用户栏目专家坐堂 → 值 '10.2961574074074' 转换成数据类型 int 时失败


  共有3323人关注过本帖树形打印复制链接

主题:值 '10.2961574074074' 转换成数据类型 int 时失败

帅哥哟,离线,有人找我吗?
cnsjroom
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:七尾狐 帖子:1571 积分:11238 威望:0 精华:0 注册:2021/1/17 17:06:00
值 '10.2961574074074' 转换成数据类型 int 时失败  发帖心情 Post By:2022/12/13 16:56:00 [只看该作者]

错误的事件名称
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


 回到顶部
帅哥哟,离线,有人找我吗?
有点蓝
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:107718 积分:547917 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2022/12/13 17:13:00 [只看该作者]

cmd.CommandText = "up date 办案装备_管理台账  set 已借用天数="& bbb  & " where guid='" & Product &"'"

 回到顶部