how do you get a value...

Discussion in 'ASP .Net' started by Lerp, May 11, 2004.

  1. Lerp

    Lerp Guest

    hi,

    How do you get a value, say a clientname, from a CLIENT table in a dataset
    based on the clientid value in another table called ORDER through a data
    relation called 'mydatarelation'? A CLIENT may have one or more ORDERS.

    I have not been able to find any examples on this, can anybody help?


    Cheers, Lerp
    Lerp, May 11, 2004
    #1
    1. Advertising

  2. This is some hacky code, but I am not sure exactly what you are wanting.

    DataSet ds = //DataSet
    DataTable tblClient = ds.Tables["ClientTable"];

    //pull the clientid that you want to look up.
    string clientID = GetClientID();

    //You can do a select on the table to get the DataRows.
    //it will return an array of DataRows that have the clientID equal to the
    clientID.
    DataRow [] rows = tblClient.Select( "clientID = " + clientID );

    //also if the ClientID column is the PrimaryKey column for tblClients
    DataRow row = tblClient.Rows.Find( clientID );

    bill

    "Lerp" <> wrote in message
    news:...
    > hi,
    >
    > How do you get a value, say a clientname, from a CLIENT table in a dataset
    > based on the clientid value in another table called ORDER through a data
    > relation called 'mydatarelation'? A CLIENT may have one or more ORDERS.
    >
    > I have not been able to find any examples on this, can anybody help?
    >
    >
    > Cheers, Lerp
    >
    >
    William F. Robertson, Jr., May 11, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Doris Cox
    Replies:
    0
    Views:
    530
    Doris Cox
    Dec 2, 2003
  2. Dennis
    Replies:
    0
    Views:
    678
    Dennis
    Dec 2, 2003
  3. Dennis
    Replies:
    0
    Views:
    437
    Dennis
    Dec 2, 2003
  4. pek
    Replies:
    0
    Views:
    1,081
  5. johannes falcone
    Replies:
    6
    Views:
    983
    johannes falcone
    May 16, 2013
Loading...

Share This Page