no value given for one or more required parameters.

  • Thread starter Thread starter liezel_15
  • Start date Start date
L

liezel_15

Guest
how can i put parameters in this code, when im entering text on the txtsearchkey, i got error of no value given for one or more required parameters.
im just starting to learn vb, help me..



Try
ListView1.AllowColumnReorder = True
ListView1.Items.Clear()
con.Open()
Dim cmd As New OleDbCommand("SELECT * FROM CLIENT where " + TextBox1.Text + " like %" & txtsearchkey.Text & "% ORDER BY BIRTHDATE", con)
Dim dr As OleDbDataReader = cmd.ExecuteReader




Dim i As Integer = 0
While dr.Read()
ListView1.Items.Add(dr("NAME_CLIENT"))
ListView1.Items(i).SubItems.Add(dr("ADDRESS"))
ListView1.Items(i).SubItems.Add(dr("AGE"))
ListView1.Items(i).SubItems.Add(dr("BIRTHDATE"))
ListView1.Items(i).SubItems.Add(dr("GENDER"))
ListView1.Items(i).SubItems.Add(dr("STATUS"))
ListView1.Items(i).SubItems.Add(dr("EDUCATIONAL_ATTAINMENT"))
ListView1.Items(i).SubItems.Add(dr("RELIGION"))
i += 1

End While

Catch ex As Exception
MsgBox(ex.Message)
End Try
con.Close()

Continue reading...
 
Back
Top