We help IT Professionals succeed at work.

Error when doing a Query Search on my Dataset in VB.Net

Medium Priority
206 Views
Last Modified: 2012-05-11
I have a VB.Net Windows Application that uses a MS Access Database.  One of the functions of the application reads from an Excel file that contains employee info of which one of the fields is the SSN.  It uses the SSN to see if the employee exists in the MS Access database using the following code (ec.SSN is declared as a String):

                        queryStr = "SSN=" & ec.SSN  
                        EmployeeRowArray = Me.HwDataSet.Employee.Select(queryStr)
                        If EmployeeRowArray.Count > 0 Then

Everything works fine until I get to a row in the Excel file whose SSN is 451xxxx10.  I get the error shown in the attached file when I execute EmployeeRowArray = Me.HwDataSet.Employee.Select(queryStr) and I can't figure out why.  Initially I thought it had something to do with a limit and the SSN was greater than that limit but the file has other SSNs that are greater than 451xxxx10 and it works fine.  If I remove the row that has 451xxxx10 as it's SSN, the function works fine.  This leads me to believe that it is a data problem but I can't figure out what is different about this particular row.  Any help would be greatly appreciated. VB Error
Comment
Watch Question

Full Stack .NET Developer
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION

Author

Commented:
Thank you.  That fixed it.
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.