Foxtable(狐表)用户栏目专家坐堂 → type 'Guid' to type 'String' is not valid的错误


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

主题:type 'Guid' to type 'String' is not valid的错误

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


加好友 发短信
等级:六尾狐 帖子:1436 积分:10602 威望:0 精华:0 注册:2014/8/13 16:19:00
type 'Guid' to type 'String' is not valid的错误  发帖心情 Post By:2021/5/19 15:46:00 [只看该作者]

Dim strCn As String
strCn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Vars("gsCpcMs") & "\cpms.mdb;Persist Security Info=False;Jet OLEDB:Database Password=123"
Connections.Add("cpcDB",strCn)
Dim cmd As new SQLCommand
cmd.C
cmd.CommandText = "sel ect * from DZSQ_KHD_SHENQINGXX wh ere SHENQINGH <> '' and SHENQINGH is not null"
Dim dt As DataTable = cmd.ExecuteReader
Dim drNew As DataRow
For Each dr As DataRow In dt.DataRows
    drNew = DataTables("rdCPC申请信息").addnew
    drNew("申请编号") = dr("SHENQINGBH")     
next


红色字体部分报错:
Exception has been thrown by the target of an invocation.
Conversion from type 'Guid' to type 'String' is not valid.

加cstr()也不行。

咋整?

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


加好友 发短信
等级:六尾狐 帖子:1436 积分:10602 威望:0 精华:0 注册:2014/8/13 16:19:00
  发帖心情 Post By:2021/5/19 15:59:00 [只看该作者]

改成tostring解决了。
但是从access中读日期,怎么老是读成了0001-01-01

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


加好友 发短信
等级:超级版主 帖子:106603 积分:542186 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2021/5/20 8:40:00 [只看该作者]

没有值默认就是0001-01-01

 回到顶部