Ver Mensaje Individual
  #23 (permalink)  
Antiguo 04/05/2011, 12:52
guillebomtrasmiti
 
Fecha de Ingreso: noviembre-2010
Ubicación: madrid
Mensajes: 478
Antigüedad: 13 años, 6 meses
Puntos: 5
Respuesta: suma la cantidad solo 1º celda

tambien he probado esto, pero además de que sigue cambiando toda la tabla me toma solo el importe de la primera celda y me iguala todos los importes a este...ahhhhh me muero'''

Dim adapt As New OleDbDataAdapter
Dim setda As New DataSet
Dim com = conexion.CreateCommand
adapt.UpdateCommand = com
com.CommandType = CommandType.Text
com.CommandText = "UPDATE IntroduccionDeVentasAhora SET Pts =ROUND (@Pts / (" & TxtPorcentaje.Text & "/100),2) Where NombreFormaPago <> ('TARJETA CREDITO')"

For i As Integer = 0 To DgTotales.Rows.Count - 1
com.Parameters.AddWithValue("@Pts", DgTotales.Rows(i).Cells(2).Value)
Next

conexion.Open()
Convert.ToDecimal(CInt(com.ExecuteNonQuery()))
DgTotales.Rows.Remove(DgTotales.CurrentRow)
conexion.Close()