老师您好!
我在窗口中添加了三个表控件,想输入三个不同的项目号,分别依次在三个表中显示不同的内容,我写的代码,如果输入三个项目号,就跳过第二个窗口table,在第3个里显示数据,然后报错找不到第4个窗口table。不知道我循环错在哪里,谢谢!
Dim b1 As WinForm.TextBox = e.Form.Controls("TextBox1")
Dim value As String = b1.value
Dim Names() As String = Value.Split(chr(13))
Dim dt As DataTable
Dim cmd As New SQLCommand
cmd.C
cmd.CommandText = "S elect [_Identify],上一工序,项目号 From {项目进度计算表} Wh ere 清单条码编码 is not null" '注意要包括主键列
dt = cmd.ExecuteReader(True) '注意可选参数设置为True
Dim v As String
Dim n As Integer = 0
For Each name As String In Names
n = n + 1
name = name.replace(chr(10), "")
name = trim(name)
v = Str(n)
Dim xx As String = "Table" & Trim(v)
Tables("项目工序进度提示屏_" & xx & "").fill("S elect [_identify],[序号],[上一工序],[项目号],[产品名称] F rom {项目进度计算表} where 项目号='" & name & "'", "沃德车间数据", True)
cmd.ExecuteNonQuery()
DataTables ("项目进度计算表").Load()
Next