简体   繁体   中英

No value given for one or more required parameters in select query

Something is wrong with the select query. How can I add the right thing after (where)?

Private Sub sal_b1_Click(sender As Object, e As EventArgs) Handles sal_b1.Click
    If ComboBox3.Text <> "" Then
        Try
            Me.Refresh()
            con.Open()
            ds = New DataSet
            tables = ds.Tables
            da = New OleDbDataAdapter("Select inv_sall2.outdate, inv_sall2.custName, inv_sall2.ac, inv_sall2.subtotal, inv_sall2.taf, inv_sall.itemName, inv_sall.quntity, inv_sall.itemPrice, inv_sall.Tottal From inv_sall INNER Join inv_sall2 On inv_sall.no = inv_sall2.invoceno WHERE (((inv_sall2.invoceno)= '" & ComboBox3.Text & "'));", con)
            da.Fill(Form2.hazemDataSet, "datatable1")
            Form2.Show()
            con.Close()
        Catch ex As Exception
            MsgBox(ex.Message)
        End Try
    Else
        MsgBox("please select the invoice number")
    End If
End Sub

Just change it like:

WHERE inv_sall2.invoceno = " & ComboBox3.Text & ";", con)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM