Ver Mensaje Individual
  #7 (permalink)  
Antiguo 05/05/2011, 08:21
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

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 Fecha BETWEEN @FI AND @FF and CODIGO = @codigo"
'Donde X vendrian a ser el indice de la columna en la cual se encuentran los valores(representada en numeros 0,1,2,3....)
com.Parameters.AddWithValue("@Pts", (DgTotales.CurrentRow.Cells(2).Value.ToString()))
com.Parameters.AddWithValue("@codigo", (DgTotales.CurrentRow.Cells(2).Value.ToString()))


com.Parameters.AddWithValue("@FI", Fecha1.Value.Date.ToString("dd/MM/yyyy"))
com.Parameters.AddWithValue("@FF", Fecha2.Value.Date.ToString("dd/MM/yyyy"))

adapt.SelectCommand = com

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

te pong todo el código junto con tu cambio, me da error el error es el siguiente;

No coinciden los tipos de datos en la expresión de criterios.

voy a investigar.... :)(