Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Cannot get Query to work VB 2010

Blaine65Blaine65 Posts: 2Member
Hello I am trying to get a query to work with Visual Basic 2010 Express addition I have pasted the code below but it just errors out with to many arguments I have taken this sample from a reference book but cannot get the darn thing to work. I have looked all over the net and Microsoft for a solution but still no go if any one can help it would really be great. BEP



Private Sub FillBypeeps1ToolStripButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles FillBypeeps1ToolStripButton.Click
Try
Me.TblMaintPeepsTableAdapter.FillBypeeps1(Me._Progressive_1_MaintPeeps.TblMaintPeeps, (Me.ToolStripTextBox1.Text))
Catch ex As System.Exception
System.Windows.Forms.MessageBox.Show(ex.Message)
End Try

End Sub

Comments

  • nc72nc72 Posts: 4Member
    Some days ago I was facing that kind of problem with one of my custom software. Mr. Kyle Gush help me in this problem. Kyle Gush of New York is an expert programmer. You may contact with him.
  • nc72nc72 Posts: 4Member
    This post has been deleted.
  • Blaine65Blaine65 Posts: 2Member
    Managed to get tis to work. The issue is about the type of tables you are trying to query Access and SQL server behave differently. The real issue is that there are very few examples that explain it even in the microsoft website. The qurey that works and the VB code is below. This gets rid of the overflow error and allows a user to enter an open ended string to search by bottom line is all is good. Thanks for the help.


    [b]Query[/b]

    SELECT PeepsID, PeepsPersonelNum, PeepsFrstNam, PeepsLastNam, [PeepsPhone#], [PeepsAltPhone#], PeepsShift, PeepsFullName
    FROM TblMaintPeeps
    WHERE (PeepsLastNam like '%' + ? + '%' )


    [b]VB Code:[/b]

    Private Sub FillBypeeps1ToolStripButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles FillBypeeps1ToolStripButton.Click
    Dim PeepsLastNam As String

    PeepsLastNam = ToolStripTextBox1.Text

    Try
    Me.TblMaintPeepsTableAdapter.FillBypeeps1(Me._Progressive_1_MaintPeeps.TblMaintPeeps, PeepsLastNam)
    Catch ex As System.Exception
    System.Windows.Forms.MessageBox.Show(ex.Message)
    End Try

    End Sub
Sign In or Register to comment.