VB.NET

Moderators: seancampbell
Number of threads: 4022
Number of posts: 10035

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Cannot get Query to work VB 2010 Posted by Blaine65 on 1 Sept 2011 at 2:44 PM
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
Report
Re: Cannot get Query to work VB 2010 Posted by nc72 on 2 Sept 2011 at 3:38 AM
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.
Report
Re: Cannot get Query to work VB 2010 Posted by Blaine65 on 3 Sept 2011 at 9:07 AM
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.


Query

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


VB Code:

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
Report
This post has been deleted. Posted by nc72 on 2 Sept 2011 at 3:41 AM
This post has been deleted.



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.