以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  报错  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=173524)

--  作者:aaa1234
--  发布时间:2021/12/3 14:05:00
--  报错
.NET Framework 版本:4.0.30319.42000
Foxtable 版本:2021.10.16.1
错误所在事件:
详细错误信息:
未能启用约束。一行或多行中包含违反非空、唯一或外键约束的值
老师您好,我在添加数据的时候他报这个是应该如何解决呢

--  作者:有点蓝
--  发布时间:2021/12/3 14:14:00
--  
压缩一下项目

看看是哪个表出错,把和这个表有关的关联删除重建一下

--  作者:aaa1234
--  发布时间:2021/12/20 10:32:00
--  
老师我想问一下Dim json As String = e.PlainText
Dim jo As JObject = JObject.Parse(json)
str=jo("username")
 如果jo("username")判断为空怎么写
[此贴子已经被作者于2021/12/20 10:34:19编辑过]

--  作者:有点蓝
--  发布时间:2021/12/20 10:40:00
--  
if jo("username") is nothing then
msgbox("为空")

--  作者:aaa1234
--  发布时间:2021/12/20 11:02:00
--  
Dim json As String = e.PlainText
Dim jo As JObject = JObject.Parse(json)
str=jo("username")
Dim dr As DataRow = DataTables("web端用户表").find("用户名=\'" & str & "\'")
If dr IsNot Nothing AndAlso dr("密码") = jo("password") Then
If jo("oldpassword") Is Nothing Then
e.writestring("为空")
Else
e.writestring(jo("oldpassword"))
End If
Else
e.writestring("失败")
End If  不行啊老师jo("oldpassword") 为空的时候还是显示e.writestring(jo("oldpassword"))

--  作者:有点蓝
--  发布时间:2021/12/20 11:44:00
--  
说明前端传入的不是空值

msgbox(jo("oldpassword").tostring) 显示什么