str1 = Forms ("main").Controls (" sfzh").Text
Dim cmd As New SQLCommand
Dim t2 As Table = Tables("main_table2")
cmd.ConnectionName= "dyx"
cmd.CommandText = "Select * From {rykz} Where公民身份号码 = \'" & str1 & "\'"
t2.DataSource = cmd.ExecuteReader()
‘’去掉下面其它代码
然后把窗口控件绑定到main_table2窗口表