Ver Mensaje Individual
  #12 (permalink)  
Antiguo 05/05/2011, 13:40
guillebomtrasmiti
 
Fecha de Ingreso: noviembre-2010
Ubicación: madrid
Mensajes: 478
Antigüedad: 13 años, 5 meses
Puntos: 5
Respuesta: cambio cantidad celda datagridview

AMIGOS SE HIZO EL MILAGRO, AQUÍ OS DEJO EL CÓDIGO FUNCIONANDO POR SI ALGUIEN LO NECESITA ALGUNA VEZ, UN ABRAZO

Dim result As DialogResult
result = MessageBox.Show("Esta seguro que desea cambiar el precio de la celda?", "Cambiar Pvp", MessageBoxButtons.OKCancel, MessageBoxIcon.Question)
Dim adapt As New OleDbDataAdapter
Dim setda As New DataSet
Dim com = conexion.CreateCommand

com.CommandType = CommandType.Text
com.CommandText = "UPDATE IntroduccionDeVentasAhora SET Pts = @Pts where NombreFormaPago <> ('TARJETA CREDITO') and Plu = @codigo and Fecha BETWEEN @FI AND @FF"
com.Parameters.AddWithValue("@Pts", (DgTotales.CurrentRow.Cells(2).Value))
com.Parameters.AddWithValue("@codigo", (DgTotales.CurrentRow.Cells(8).Value))
com.Parameters.AddWithValue("@FI", Fecha1.Value.Date.ToString("dd/MM/yyyy"))
com.Parameters.AddWithValue("@FF", Fecha2.Value.Date.ToString("dd/MM/yyyy"))

If result = System.Windows.Forms.DialogResult.OK Then

adapt.SelectCommand = com
conexion.Open()
Convert.ToDecimal(CInt(com.ExecuteNonQuery()))
ElseIf result = System.Windows.Forms.DialogResult.Cancel Then

End If

DgTotales.Refresh()
conexion.Close()