Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7038413
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T01:39:58+00:00 2026-05-28T01:39:58+00:00

I have a TypedDataTable called CamerasDT which has a composite Primary Key of GroupId

  • 0

I have a TypedDataTable called CamerasDT which has a composite Primary Key of GroupId and CameraId. I want to use TypedDataTable.Rows.Find(key as object) to return a specific row by GroupId and CameraId. I don’t seem to be able to find a way to send primary key to the find function. Any help is appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T01:39:59+00:00Added an answer on May 28, 2026 at 1:39 am

    Use the one of the overloads for the Find method to pass an array of Objects that corresponds to the primary key values you’re searching for.

    Example from the MSDN article I linked:

    The following example uses the values of an array to find a specific
    row in a collection of DataRow objects. The method assumes that a
    DataTable exists with three primary key columns. After creating an
    array of the values, the code uses the Find method with the array to
    get the particular object that you want.

     Private Sub FindInMultiPKey(ByVal table As DataTable)
        ' Create an array for the key values to find.
        Dim findTheseVals(2) As Object
    
        ' Set the values of the keys to find.
        findTheseVals(0) = "John"
        findTheseVals(1) = "Smith"
        findTheseVals(2) = "5 Main St."
    
        Dim foundRow As DataRow = table.Rows.Find(findTheseVals)
        ' Display column 1 of the found row.
        If Not (foundRow Is Nothing) Then
            Console.WriteLine(foundRow(1).ToString())
        End If
    End Sub
    

    In your case you’d pass an Object array with values to search for in your GroupId and CameraId fields.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Have a simple form that has a PictureBox in one location. I want to
I have a strongly-typed datatable and I search for a row by primary key
have written this little class, which generates a UUID every time an object of
Have a procedure which looks like Procedure TestProc(TVar1, TVar2 : variant); Begin TVar1 :=
Have deployed numerous report parts which reference the same view however one of them
Have two tables say ABC and XYZ and contain one column which data will
I came across a problem while updating a typed DataTable that has a primary
Have finally got a responsive site working (of a fashion). What I want to
Have a look at the following code to find X^y. /* Find exponent in
I have a strongly typed dataset with a strongly typed datatable which i pass

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.