Rss & SiteMap
Foxtable(狐表) http://www.foxtable.com
下载信息 [文件大小: 下载次数: ] | |
点击浏览该文件:关联测试.table |
Dim cmd As SQLCommand
这里原有连接语句
Dim ls As DataTable
Dim dt As integer
Dim dr As string = e.form.controls("ComboBox1").Value
cmd.commandtext = "select 第三列 From [表B] where 第一列 = '"& dr &"' and 第二列 = ''"
ls = cmd.ExecuteReader()
dt = ls.datarows.count
if dt > 0 Then
Return
Else
Tables("表A.表B").AddNew()
end if
Dim cmd As SQLCommand
cmd.Con nection Name= "zygl"
Dim ls As DataTable
Dim dt As integer
Dim dr As string = e.form.controls("TextBox6").Value
cmd.commandtext = "select 项目 From [长嘱] where 住院ID = '"& dr &"'and 单价 is null"
ls = cmd.ExecuteReader()
dt = ls.datarows.count
if dt = 0 Then
Tables("住院登记.长嘱").AddNew()
end if
此主题相关图片如下:q001.jpg
那里是故意的..不打空格,论坛显示不到...
Dim cmd As New SQLCommand
Dim ls As DataTable
Dim dt As integer
Dim dr As string = e.form.controls("ComboBox1").Value
cmd.commandtext = "select 第三列 From {表B} where 第一列 = '"& dr &"' and 第二列 is null"
ls = cmd.ExecuteReader()
dt = ls.datarows.count
if dt > 0 Then
Return
Else
Tables("表A.表B").AddNew()
end if
如果是内部数据源,SQL语句中的表名必须用大括号括起来,外部数据源没有这个限制。