| | |
TableAdapter.Update return PrimaryKey value
Please support our ASP.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Aug 2007
Posts: 57
Reputation:
Solved Threads: 1
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
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)
Dim dt As New DA.Repositorio.ItemMostradorDataTable ItemMostradorTA.FillByKey(dt, Me.id, Nothing) With dt.Rows(0) '.Item("itemm_id") = Me.id .Item("itemm_descripcion") = Me.descripcion .Item("unime_id") = Me.unime_id .Item("categ_id") = Me.categ_id .Item("itemm_codigo_barras") = Me.itemm_codigo_barras .Item("itemm_minimo_alerta") = Me.minimo_alerta .Item("itemm_costo") = Me.itemm_costo .Item("itemm_precio_venta") = Me.itemm_precio_venta .Item("mostr_id") = Me.repositorio_id .Item("itemm_estado_registro") = Me.estado_registro .Item("creado_usuario") = Me.creado_usuario .Item("creado_fecha") = IIf(Me.creado_fecha.Ticks = 0, System.DBNull.Value, Me.creado_fecha) .Item("modificado_usuario") = Me.modificado_usuario .Item("modificado_fecha") = IIf(Me.modificado_fecha.Ticks = 0, System.DBNull.Value, Me.modificado_fecha) End With response = ItemMostradorTA.Update(dt)
![]() |
Similar Threads
- Starting Python (Python)
- Shopping Cart Not Working (ASP.NET)
- Save update in Micrifoft Access (VB.NET)
- Sending update commands directly (C#)
- svchost.exe - Windows Update - 100% CPU Utilization fix (EASY) (Windows NT / 2000 / XP)
- Table Adapters (Visual Basic 4 / 5 / 6)
- TableAdapter Update Method (VB.NET)
- New Python Problem (Python)
- radio button validation issue (HTML and CSS)
Other Threads in the ASP.NET Forum
- Previous Thread: hello ppl ....!!!
- Next Thread: Replace Equivalent
| Thread Tools | Search this Thread |
Tag cloud for ASP.NET
.net 2.0 3.5 ajax alltypeofvideos appliances application asp asp.net beginner box browser businesslogiclayer button c# cac checkbox class complex control countryselector dataaccesslayer database datagrid datagridview datalist deployment development dgv dialog dropdownlist dropdownmenu dynamic dynamically edit editing embeddingactivexcontrol feedback fileuploader fill findcontrol flash folder form gridview gudi iis image javascript list listbox login maps mobile mouse mssql nameisnotdeclared news novell numerical opera panelmasterpagebuttoncontrols parent problem project radio redirect registration relationaldatabases reportemail response.redirect richtextbox rows schoolproject search security select sessionvariables silverlight smoobjects software sql sql-server ssl tracking treeview validatedate validation vb.net videos vista visualstudio vs2008 web webapplications webdevelopment webprogramming webservice wizard xsl





