title: Temp primary key is not back filled
body: <p>I'm using a typed data set in which I have a header table and child table.
  I have defined as well a relation between the 2 tables.</p>
  
  <p>When I create a new record in the Header table, it has a temporary primary key (-1) which is then automatically transferred in the FK_ID of the child table.
  The problem is the real/final primary key generated by SQL Server is not backfilled in the table row. Therefore when the child row is inserted in SQL Server, the foreign key value is -1 and it generates an error.</p>
  
  <p>Here below is my code:</p>
  
  <pre><code>    Dim dsAdminRate As New dsAdministrativeRates
      Dim daRateHeader As New dsAdministrativeRatesTableAdapters.ADMIN_RATES_HEADERTableAdapter
      Dim drRateHeader As dsAdministrativeRates.ADMIN_RATES_HEADERRow
      Dim daRateLine As New dsAdministrativeRatesTableAdapters.ADMIN_RATES_LINESTableAdapter
      Dim drRateLine As dsAdministrativeRates.ADMIN_RATES_LINESRow
  
      Try
          ' Create a new row.
          drRateHeader = dsAdminRate.ADMIN_RATES_HEADER.NewADMIN_RATES_HEADERRow
          With drRateHeader
              .RATE_NAME = txtRateName.Text
              .SOURCE_CCY_ID = ddlSourceCurrency.SelectedValue
              .DESTINATION_CCY_ID = ddlDestinationCurrency.SelectedValue
              .PERIODICITY_ID = ddlPeriodicity.SelectedValue
          End With
          ' Add the row to the ADMIN_RATES_HEADER table
          dsAdminRate.ADMIN_RATES_HEADER.Rows.Add(drRateHeader)
  
  
  
          ' Create a new exchange rate
          drRateLine = dsAdminRate.ADMIN_RATES_LINES.NewADMIN_RATES_LINESRow
          With drRateLine
              .SetParentRow(drRateHeader)
              .START_DATE = 20171213
              .END_DATE = 20171213
              .S_D_RATE = 1.2
              .D_S_RATE = 1 / 1.2
              .FK_ADMIN_RATES_HEADER = drRateHeader.ID
          End With
          ' Add the row to the ADMIN_RATES_LINES table
          dsAdminRate.ADMIN_RATES_LINES.Rows.Add(drRateLine)
  
          ' Save the header row to the database
          daRateHeader.Update(dsAdminRate.ADMIN_RATES_HEADER)
  
          ' Save the child row to the database
          daRateLine.Update(dsAdminRate.ADMIN_RATES_LINES)
  
      Catch ex As Exception
          ucMessage.Display("error", "An error occured: " &amp; ex.Message)
      Finally
          dsAdminRate = Nothing
          daRateHeader = Nothing
          drRateHeader = Nothing
          daRateLine = Nothing
          drRateLine = Nothing
      End Try
  </code></pre>
  
  <p>Till so far I was not able to find an example or to understand why it behaves like this.</p>
  
  <p>Thank in advance for your kind help</p>