culebrin 0 Junior Poster in Training

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

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)
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.