以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  关于窗口查询功能访问外部数据源的问题  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=10431)

--  作者:xiaoqiwei
--  发布时间:2011/6/5 2:24:00
--  关于窗口查询功能访问外部数据源的问题


图片点击可在新窗口打开查看此主题相关图片如下:未命名.jpg
图片点击可在新窗口打开查看

图片点击可在新窗口打开查看此主题相关图片如下:未命名-1.jpg
图片点击可在新窗口打开查看

查询按钮代码如下:

Dim re As String = e.Form.Controls("内容").Value
Dim dr As DataRow
If re="" Then
MessageBox.Show("请输入要查询的内容!", "错误提示", MessageBoxButtons.ok, MessageBoxIcon.Information)
Else
dr = DataTables("user").Find("[username] =\'" & re & "\' ")
e.Form.Controls("TextBox2").Value=dr("username")
e.Form.Controls("TextBox3").Value=dr("nl")
e.Form.Controls("TextBox4").Value=dr("bumen")
e.Form.Controls("TextBox5").Value=dr("zhiwei")
End If

 

问题:如何实现当输入的要查询的内容不存在时就弹出提示“暂未查询到该用户资料!”

Dim re As String = e.Form.Controls("内容").Value
Dim dr As DataRow
If re="" Then
MessageBox.Show("请输入要查询的内容!", "错误提示", MessageBoxButtons.ok, MessageBoxIcon.Information)
Else
dr = DataTables("user").Find("[username] =\'" & re & "\' ")
If “输入的内容不存在" then

MessageBox.Show("暂未查询到该用户资料!", "错误提示", MessageBoxButtons.ok, MessageBoxIcon.Information)
Else

e.Form.Controls("TextBox2").Value=dr("username")
e.Form.Controls("TextBox3").Value=dr("nl")
e.Form.Controls("TextBox4").Value=dr("bumen")
e.Form.Controls("TextBox5").Value=dr("zhiwei")
End If

End If

 


--  作者:e-png
--  发布时间:2011/6/5 8:14:00
--  

 \' 帮助中到处都是If dr isnot nothing :::::

 

dr = DataTables("user").Find("[username] =\'" & re & "\' ")
If dr is nothing  then

MessageBox.Show("暂未查询到该用户资料!", "错误提示", MessageBoxButtons.ok, MessageBoxIcon.Information)
Else


--  作者:xiaoqiwei
--  发布时间:2011/6/5 15:00:00
--  
图片点击可在新窗口打开查看非常感谢!