ComboBox1的MouseEnter里有如下代码:
Dim cmd As New SQLCommand
cmd.Con nection Name = "zygl"这里故意留空格的.
Dim lst As WinForm.ComboBox
Dim dt As DataTable
cmd.CommandText = "Select 床位 From [住院登记] where 出院结账 = False"
dt = cmd.ExecuteReader()
lst = e.Form.Controls("ComboBox1")
lst.Items.clear
If dt.datarows.count >0 Then
For Each dr As Datarow In dt.Datarows
lst.Items.Add(dr("床位"))
Next
End If
当住院登记表里所有行床位列都为空时报错......WHY?
此主题相关图片如下:001.jpg
[此贴子已经被作者于2009-1-13 9:06:37编辑过]