我想在我的 Combobox 中显示我的查询结果,但我收到一个错误“无效参数或未传递参数”。任何意见是极大的赞赏。这是我的代码。
Private Sub frmAdvancePayment_Load(sender As Object, e As EventArgs) Handles MyBase.Load
lstBillNum.Items.Clear()
txtLName.Text = frmAmortizationFee.txtLName.Text
txtFName.Text = frmAmortizationFee.txtFName.Text
lblMaAmount.Text = frmAmortizationFee.txtAmort.Text
lblAcctNum.Text = frmAmortizationFee.cmbAccountNo.Text
Dim connection_string As String = "Data Source=.\sqlexpress;Initial Catalog=CreditAndCollection;Integrated Security=True"
Dim Connection As New SqlConnection(connection_string)
Dim da As New SqlDataAdapter
Dim command As New SqlCommand
command.Connection = Connection
command.CommandText = "showBillingNum"
command.CommandType = CommandType.StoredProcedure
command.Parameters.AddWithValue("@AcctNum", lblAcctNum.Text)
Connection.Open()
da.SelectCommand = command
Dim dt As New DataSet
da.Fill(dt)
cmbBillNum.DataSource = dt
cmbBillNum.DisplayMember = "BillNum"
cmbBillNum.ValueMember = "BillNum"
command.ExecuteNonQuery()
Connection.Close()
End Sub