| | |
TableAdapter.Update return PrimaryKey value
Please support our ASP.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Aug 2007
Posts: 56
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 |
.net 2.0 ajax alltypeofvideos appliances application asp asp.net bc30451 beginner box browser button c# cac checkbox class commonfunctions control countryselector dataaccesslayer database datagridview datagridviewcheckbox datalist deployment development dgv dialog dropdownlist dynamic dynamically edit embeddingactivexcontrol expose feedback fileuploader fill findcontrol flash form formatdecimal formview gridview gudi iis javascript listbox login microsoft mouse mssql news novell numerical opera panelmasterpagebuttoncontrols parent problem radio redirect registration relationaldatabases reportemail save schoolproject search security select sessionvariables silverlight smartcard smoobjects software sql sql-server sqlserver2005 ssl suse textbox tracking treeview unauthorized validatedate validation vb.net video videos vista visualstudio vs2008 web webapplications webdevelopemnt webdevelopment webprogramming webservice wizard xsl youareanotmemberofthedebuggerusers





