TableAdapter.Update return PrimaryKey value

Please support our ASP.NET advertiser: Intel Parallel Studio Home
Reply

Join Date: Aug 2007
Posts: 56
Reputation: culebrin is an unknown quantity at this point 
Solved Threads: 1
culebrin culebrin is offline Offline
Junior Poster in Training

TableAdapter.Update return PrimaryKey value

 
0
  #1
Jun 29th, 2009
Hi,

I have a dataset build at design time (vs 2008) with several tables of my DB (MSSQL 2005).

I have a DataTable with its tableadapter... I need that the TableAdapter.Update function returns the key updated (always will be a single row updated at the time).

I know, I passed the primarykey to filter the update statement, so it means that I already have the value, but I really need the update function return the key value ...

I tried replacing the update commandtext value replacing the last select statement with "select @keyparameter" statement and executing it as Scalar... but no luck...

Please someone can help me with this... It would very apreciated...

Thanks

  1. Dim dt As New DA.Repositorio.ItemMostradorDataTable
  2. ItemMostradorTA.FillByKey(dt, Me.id, Nothing)
  3.  
  4. With dt.Rows(0)
  5. '.Item("itemm_id") = Me.id
  6. .Item("itemm_descripcion") = Me.descripcion
  7. .Item("unime_id") = Me.unime_id
  8. .Item("categ_id") = Me.categ_id
  9. .Item("itemm_codigo_barras") = Me.itemm_codigo_barras
  10. .Item("itemm_minimo_alerta") = Me.minimo_alerta
  11. .Item("itemm_costo") = Me.itemm_costo
  12. .Item("itemm_precio_venta") = Me.itemm_precio_venta
  13. .Item("mostr_id") = Me.repositorio_id
  14. .Item("itemm_estado_registro") = Me.estado_registro
  15. .Item("creado_usuario") = Me.creado_usuario
  16. .Item("creado_fecha") = IIf(Me.creado_fecha.Ticks = 0, System.DBNull.Value, Me.creado_fecha)
  17. .Item("modificado_usuario") = Me.modificado_usuario
  18. .Item("modificado_fecha") = IIf(Me.modificado_fecha.Ticks = 0, System.DBNull.Value, Me.modificado_fecha)
  19. End With
  20.  
  21. response = ItemMostradorTA.Update(dt)
  22.  
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the ASP.NET Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC