下面的代码看看有什么问题没有?我操作后没有任何效果,但是我加上msg看看结果时,奇迹发生了,我点完MSG的确定后,该得到的信息就有了,不知道什么原因,去掉MSG,就不行了
Valuechanged:事件
Dim sxr As WinForm.ComboBox = e.Form.Controls("ComboBox2")
Dim cj As WinForm.ComboBox = e.Form.Controls("ComboBox1")
Dim ly As WinForm.TextBox = e.Form.Controls("TextBox2")
Dim cmd As New SQLCommand
Dim dt As DataTable
Dim dr As String = e.Form.Controls("ComboBox3").value
cmd.C
cmd.CommandText = "SELECT * From kehu Where mingcheng = '" & dr & "'"
MessageBox.Show(dr)
dt = cmd.ExecuteReader
If dt.DataRows.Count > 0 Then
cj.Text = dt.DataRows(0)("jigou")
ly.Text = dt.DataRows(0)("laiyuanjigou")
sxr.Text = dt.DataRows(0)("sxren")
Else
cj.Text = Nothing
ly.Text = Nothing
sxr.Text = Nothing
End If
[此贴子已经被作者于2014-5-27 9:41:38编辑过]