943,907 Members | Top Members by Rank

Ad:
  • ASP.NET Discussion Thread
  • Unsolved
  • Views: 986
  • ASP.NET RSS
Jun 29th, 2009
0

TableAdapter.Update return PrimaryKey value

Expand Post »
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

ASP.NET Syntax (Toggle Plain Text)
  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.  
Similar Threads
Reputation Points: 10
Solved Threads: 1
Junior Poster in Training
culebrin is offline Offline
62 posts
since Aug 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in ASP.NET Forum Timeline: hello ppl ....!!!
Next Thread in ASP.NET Forum Timeline: Replace Equivalent





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC