Rss & SiteMap

Foxtable(狐表) http://www.foxtable.com

新一代数据库软件,完美融合Access、Foxpro、Excel、vb.net之优势,人人都能掌握的快速软件开发工具!
共3 条记录, 每页显示 10 条, 页签: [1]
[浏览完整版]

标题:关于窗口查询功能访问外部数据源的问题

1楼
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

 

2楼
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

3楼
xiaoqiwei 发表于:2011/6/5 15:00:00
图片点击可在新窗口打开查看非常感谢!
共3 条记录, 每页显示 10 条, 页签: [1]

Copyright © 2000 - 2018 foxtable.com Tel: 4000-810-820 粤ICP备11091905号

Powered By Dvbbs Version 8.3.0
Processed in .02246 s, 2 queries.