以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  提示框的生成问题?  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=57020)

--  作者:jk362223
--  发布时间:2014/9/17 0:17:00
--  提示框的生成问题?
有“基本资料”和”黑名单“二个表,都有个“身份证号”列。”黑名单“表有“内容”和“黑名单”的逻辑列。当”黑名单“表的逻辑列为ture时,在“基本资料”输入相同的身份证号时,会出现一个提示框,提示框的内容是”黑名单“表的“内容”列的文字。如示例,要达到这个功能,应如何设置?请帮我。
 下载信息  [文件大小:   下载次数: ]
图片点击可在新窗口打开查看点击浏览该文件:冰糖最活跃.zip


--  作者:lsy
--  发布时间:2014/9/17 6:41:00
--  
If e.DataCol.Name = "身份证号" AndAlso e.DataRow.IsNull(e.DataCol) = False Then
    Dim fdr As DataRow = DataTables("黑名单").Find("身份证号 = \'" & e.DataRow("身份证号") & "\' And 黑名单 = True")
    If fdr IsNot Nothing Then
        MessageBox.Show(fdr("内容"))
    End If
End If

--  作者:jk362223
--  发布时间:2014/9/20 15:34:00
--  
若是”黑名单“不加载,放在后台,是外部数据源如sql201407,代码需怎改?
--  作者:Bin
--  发布时间:2014/9/20 15:41:00
--  
利用SQLCOmmand 用SQL语句查询

比较简单的做法是,不加载黑名单表的数据,但是加载表结构.

这样就可以利用

If e.DataCol.Name = "身份证号" AndAlso e.DataRow.IsNull(e.DataCol) = False Then
    Dim fdr As DataRow = DataTables("黑名单").SQLFind("身份证号 = \'" & e.DataRow("身份证号") & "\' And 黑名单 = True")
    If fdr IsNot Nothing Then
        MessageBox.Show(fdr("内容"))
    End If
End I

--  作者:jk362223
--  发布时间:2014/9/23 10:43:00
--  
回复4楼,若外部数据源如sql201407,
Dim cmd As New SQLCommand
cmd.C
If e.DataCol.Name = "身份证号" AndAlso e.DataRow.IsNull(e.DataCol) = False Then
    Dim fdr As DataRow = DataTables("黑名单").SQLFind("身份证号 = \'" & e.DataRow("身份证号") & "\' And 黑名单 = True")
    If fdr IsNot Nothing Then
        MessageBox.Show(fdr("内容"))
    End If
End If
对吗?

--  作者:有点甜
--  发布时间:2014/9/23 10:48:00
--  

 sqlCommand语法,你可以学习一下

 

http://www.foxtable.com/help/topics/0696.htm

 


--  作者:jk362223
--  发布时间:2014/9/23 11:01:00
--  
Dim cmd As New SQLCommand
Dim fdr As String  = "身份证号"
cmd.C
If e.DataCol.Name = "身份证号" AndAlso e.DataRow.IsNull(e.DataCol) = False Then
    Dim fdr As DataRow = DataTables("黑名单").SQLFind("身份证号 = \'" & e.DataRow("身份证号") & "\' And 黑名单 = True")
    If fdr IsNot Nothing Then
        MessageBox.Show(fdr("内容"))
    End If
End If
麻烦请帮我改下?

--  作者:有点甜
--  发布时间:2014/9/23 11:13:00
--  

 回复楼上你问了这么多,你从来都没有自己写过代码。

 

 你就不会学习? http://www.foxtable.com/help/topics/0696.htm

 

[此贴子已经被作者于2014-9-23 11:13:39编辑过]

--  作者:有点甜
--  发布时间:2014/9/23 11:21:00
--  
If e.DataCol.Name = "身份证号" AndAlso e.DataRow.IsNull(e.DataCol) = False Then
    Dim cmd As New SQLCommand
    cmd.CommandText = "select 内容 from {黑名单} where 身份证号 = \'" & e.DataRow("身份证号") & "\' And 黑名单 = True"
    Dim result As String = cmd.ExecuteScalar
    If result <> Nothing Then
        msgbox(result)
    End If
End If

--  作者:jk362223
--  发布时间:2014/9/23 11:29:00
--  
已看了,修改多次还是不能正确显示,还得麻烦请您帮忙改一下。