以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- 用户登录窗退出时报错 (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=79192) |
|
-- 作者:douglas738888 -- 发布时间:2015/12/25 20:20:00 -- 用户登录窗退出时报错 大红袍老师,我做了自定义用户登录窗口界面,其中取消登录的BUTTON按下后, 其他都正常! 提示: .NET Framework 版本:2.0.50727.5485 Foxtable 版本:2015.11.11.1 错误所在事件:项目,BeforeCloseProject 详细错误信息: 未将对象引用设置到对象的实例。 BUTTON的控件代码很简单就是Forms("用户登录“).Close() 帮助里的是e.Form.Close() 在BeforeCloseProject里面只有如下代码,是否对此有影响 Dim dt As DataTable = DataTables("登录操作日志") Dim dr As DataRow = dt.find(("用户 = \'" & _UserName & "\' and 退出时间 is null")) dr("用户") = _UserName dr("退出时间")= Date.Now() dt.save() |
|
-- 作者:Hyphen -- 发布时间:2015/12/26 8:46:00 -- Dim dt As DataTable = DataTables("登录操作日志")
Dim dr As DataRow = dt.find(("用户 = \'" & _UserName & "\' and 退出时间 is null"))
if dr innot nothing then
dr("用户") = _UserName
dr("退出时间")= Date.Now()
dt.save()
end if |
|
-- 作者:douglas738888 -- 发布时间:2015/12/26 9:56:00 -- if dr innot nothing then 放在BeforeCloseProject里面就报错了,DataRow不能转换为Boolean 好像把if dr innot nothing then改成if dr isnot nothing then可用,不知这样改可以吗?
|
|
-- 作者:Hyphen -- 发布时间:2015/12/26 10:16:00 -- |