Getting the follow error message: No value given for one or more required parameters.
The error message is pointing to the code part "dr = cmd.ExecuteReader"
The code which I use to connect to the database can be found on this thread
Any help would be much appreciated.
Code:Private Sub btnSearch_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSearch.Click Dim dr As OleDbDataReader Dim cmd As New OleDbCommand("SELECT * FROM tblContacts where Surname" & txtSurname.Text & "", con) dr = cmd.ExecuteReader If dr.HasRows Then dr.Read() txtfirstName.Text = dr("FirstName") End If End Sub




Reply With Quote