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


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

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

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


加好友 发短信
等级:六尾狐 帖子:1498 积分:11164 威望: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


加好友 发短信
等级:六尾狐 帖子:1498 积分:11164 威望:0 精华:0 注册:2014/8/13 16:19:00
  发帖心情 Post By:2021/5/19 15:59:00 [显示全部帖子]

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

 回到顶部