Results 1 to 2 of 2

Thread: [RESOLVED] VB 2010: No value given for one or more required parameters.

  1. #1

    Thread Starter
    New Member
    Join Date
    Sep 2011
    Posts
    6

    Resolved [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
    Last edited by hasin_arshad; Sep 21st, 2011 at 05:44 AM.

  2. #2

    Thread Starter
    New Member
    Join Date
    Sep 2011
    Posts
    6

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width