好吧,我又遇到了另一个问题,所以我有 2 个组合框,第一个称为 client_number,第二个是 order_number 好吧,当我在第一个组合中选择客户端时,我试图做下一个组合,第二个加载客户端完成的 order_number。MySql 查询是这样的:
SELECT
order.number
FROM order,client
WHERE order.client_number=client.number and client.number=" & ComboBox1.SelectedValue
当我运行程序时,第二个组合框会向我加载 order_number,但如果客户完成了多个订单,order_number 会出现,但order_number
如果客户完成 2 个订单只出现一个,则只会出现一个。我能做什么?
顺便说一句,这就是代码
Private Sub ComboBox3_SelectedIndexChanged(sender As System.Object, e As System.EventArgs) Handles ComboBox3.SelectedIndexChanged
conexao.Open()
Dim strsql As String, i As Integer = 0
Dim o As Integer
o = ComboBox2.SelectedValue
strsql = "SELECT count(order.number),order.number FROM order,client WHERE order.client_number=client.number and client.number=" & ComboBox3.SelectedValue
sqlcom = New MySqlCommand(strsql, conexao)
dr = sqlcom.ExecuteReader
If Not dr.HasRows Then
MsgBox("not find")
Else
dr.Read()
ComboBox2.Items.Add(dr("order_number"))
'TextBox10.Text = dr(0).ToString
End If
dr.Close()
conexao.Close()
End Sub
我正在使用文本框来计算数字顺序,并且文本框可以正常工作,但组合不会加载多个订单