请老师检查作业,动态列表项目,我又错哪了? Post By:2009/1/13 9:02:00 [显示全部帖子]
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