troubleshooting Question

DataTable.Rows.FIND

Avatar of Mr_Fulano
Mr_FulanoFlag for United States of America asked on
Visual Basic.NET
3 Comments1 Solution1928 ViewsLast Modified:
Hi, I have a VB 2005 Windows Application using an Access 2003 database.

In my application, I've creating a dataTable called "dtUsers" and am filling it with all the fields from the "Users" Table. I would like to use the FIND property to search the dataTable for a specific User's Last Name.  I know I can loop through all the rows one at a time until I find a match, but that seems extremely inefficient.

If dtUsers.Rows.Find("LastName") = "Finklestinkle" Then
            Console.WriteLine("I found him...!!!")
End If

I think the syntax may be wrong, and it keeps telling me the dataTable does not have a Primary Key.

Any suggestions or tutorials that might help?

Thank,
Fulano
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 3 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros