get DB results from inner join update

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Rick

    #1

    get DB results from inner join update

    VS 2005 & Firebird DB 1.5

    I have a query for Customer orders that has several inner joins to show
    things like Terms name (from termsnum) and Sales Rep name (from repnum) etc.

    I have written the custom SQL insert statement and this works with no
    problem, but I want to get the updated values back from the DB for the inner
    joins. When I add a new row, it appears in a datagridview, but all the inner
    join fields are missing. I know I could refresh the entire query, but this
    can be several hunded rows so I would rather just refresh the newly added
    row and show it. How?

    TIA

    Rick


  • Rick

    #2
    Re: get DB results from inner join update

    Well, I have figured out a way to do this:

    I wrote a get method of the adapter to return a datatable with the new row
    based on the PK. Then I datatable.merge (<new datatable>).

    I'm not sure if this is the best way to acomplish this, so if anyone has a
    better method please let me know.

    Rick


    "Rick" <Rick@LakeValle ySeed.comwrote in message
    news:u1skvJFjHH A.4768@TK2MSFTN GP05.phx.gbl...
    VS 2005 & Firebird DB 1.5
    >
    I have a query for Customer orders that has several inner joins to show
    things like Terms name (from termsnum) and Sales Rep name (from repnum)
    etc.
    >
    I have written the custom SQL insert statement and this works with no
    problem, but I want to get the updated values back from the DB for the
    inner joins. When I add a new row, it appears in a datagridview, but all
    the inner join fields are missing. I know I could refresh the entire
    query, but this can be several hunded rows so I would rather just refresh
    the newly added row and show it. How?
    >
    TIA
    >
    Rick
    >

    Comment

    • Earl

      #3
      Re: get DB results from inner join update

      A better way to do that is without the inner joins, instead using multiple
      tables and expression columns. One technique I have used is to put all the
      joined data in one read-only table, then use that as the parent for the
      expression columns in the datatable where I need the "names" to show.

      "Rick" <Rick@LakeValle ySeed.comwrote in message
      news:u1skvJFjHH A.4768@TK2MSFTN GP05.phx.gbl...
      VS 2005 & Firebird DB 1.5
      >
      I have a query for Customer orders that has several inner joins to show
      things like Terms name (from termsnum) and Sales Rep name (from repnum)
      etc.
      >
      I have written the custom SQL insert statement and this works with no
      problem, but I want to get the updated values back from the DB for the
      inner joins. When I add a new row, it appears in a datagridview, but all
      the inner join fields are missing. I know I could refresh the entire
      query, but this can be several hunded rows so I would rather just refresh
      the newly added row and show it. How?
      >
      TIA
      >
      Rick
      >

      Comment

      Working...