[RESOLVED] VB 2010: No value given for one or more required parameters.
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
Re: VB 2010: No value given for one or more required parameters.
http://www.vbforums.com/showthread.p...14#post4069014
All solved, thanks to the gentleman who answered in the above thread:D