
30/03/2005, 01:12
|
| | Fecha de Ingreso: abril-2004
Mensajes: 23
Antigüedad: 20 años, 10 meses Puntos: 0 | |
update con Access La sentencia update es la siguiente:
UPDATE datos SET aceiteanad = ?, tipoMuestraD = ?, TBN = ?, TAN = ?, SOOT = ?, Sn = ?, Si = ?, resultado = ?, recomendaciones = ?, Pb = ?, ordenprueba = ?, Ni = ?, Mo = ?, millascambio = ?, millas = ?, metodo = ?, KV40 = ?, KV100 = ?, kmcambio = ?, km = ?, IV = ?, horascambio = ?, horas = ?, H2O = ?, FP = ?, fechaTomaD = ?, fechacambio = ?, Fe = ?, Cu = ?, Cr = ?, comentarioseccion = ?, Al = ?, Ag = ? WHERE (OTD = ?) AND (matriculaD = ?)
y la carga de los parámetros la siguiente:
dsOT.Clear()
Conexion.Open()
ModificacionDatos.UpdateCommand.Parameters("aceite anad").Value = txtLitros.Text
ModificacionDatos.UpdateCommand.Parameters("tipoMu estraD").Value = txtTipoMuestra.Text
ModificacionDatos.UpdateCommand.Parameters("TBN"). Value = txtTBN.Text
ModificacionDatos.UpdateCommand.Parameters("TAN"). Value = txtTAN.Text
ModificacionDatos.UpdateCommand.Parameters("SOOT") .Value = txtCarbonilla.Text
ModificacionDatos.UpdateCommand.Parameters("Sn").V alue = txtSn.Text
ModificacionDatos.UpdateCommand.Parameters("Si").V alue = txtSi.Text
ModificacionDatos.UpdateCommand.Parameters("result ado").Value = txtResultado.Text
ModificacionDatos.UpdateCommand.Parameters("recome ndaciones").Value = txtRecomendaciones.Text
ModificacionDatos.UpdateCommand.Parameters("Pb").V alue = txtPb.Text
ModificacionDatos.UpdateCommand.Parameters("ordenp rueba").Value = txtOrdenPrueba.Text
ModificacionDatos.UpdateCommand.Parameters("Ni").V alue = txtNi.Text
ModificacionDatos.UpdateCommand.Parameters("Mo").V alue = txtMo.Text
ModificacionDatos.UpdateCommand.Parameters("millas cambio").Value = txtMilCambio.Text
ModificacionDatos.UpdateCommand.Parameters("millas ").Value = txtMillas.Text
ModificacionDatos.UpdateCommand.Parameters("metodo ").Value = txtMetodoToma.Text
ModificacionDatos.UpdateCommand.Parameters("KV40") .Value = txtVisc40.Text
ModificacionDatos.UpdateCommand.Parameters("KV100" ).Value = txtVisc100.Text
ModificacionDatos.UpdateCommand.Parameters("kmcamb io").Value = txtKmCambio.Text
ModificacionDatos.UpdateCommand.Parameters("km").V alue = txtKms.Text
ModificacionDatos.UpdateCommand.Parameters("IV").V alue = txtIV.Text
ModificacionDatos.UpdateCommand.Parameters("horasc ambio").Value = txtHoraCambio.Text
ModificacionDatos.UpdateCommand.Parameters("horas" ).Value = txtHoraToma.Text
ModificacionDatos.UpdateCommand.Parameters("H2O"). Value = txtAgua.Text
ModificacionDatos.UpdateCommand.Parameters("FP").V alue = txtPtoInf.Text
ModificacionDatos.UpdateCommand.Parameters("fechaT omaD").Value = txtFechaToma.Text
ModificacionDatos.UpdateCommand.Parameters("fechac ambio").Value = txtFecCambio.Text
ModificacionDatos.UpdateCommand.Parameters("Fe").V alue = txtFe.Text
ModificacionDatos.UpdateCommand.Parameters("Cu").V alue = txtCu.Text
ModificacionDatos.UpdateCommand.Parameters("Cr").V alue = txtCr.Text
ModificacionDatos.UpdateCommand.Parameters("coment arioseccion").Value = txtComentado.Text
ModificacionDatos.UpdateCommand.Parameters("Al").V alue = txtAl.Text
ModificacionDatos.UpdateCommand.Parameters("Ag").V alue = txtAg.Text
ModificacionDatos.UpdateCommand.Parameters("Origin al_OTD").Value = Me.cboOT.SelectedValue
ModificacionDatos.UpdateCommand.Parameters("Origin al_matriculaD").Value = Me.cboDatos.SelectedValue
ModificacionDatos.UpdateCommand.ExecuteNonQuery()
Conexion.Close()
El problema es que si cualquiera de los "TextBox" está vacio da un error :
La cadena de entrada no tiene el formato correcto.
Descripción: Excepción no controlada al ejecutar la solicitud Web actual. Revise el seguimiento de la pila para obtener más información acerca del error y dónde se originó en el código.
Detalles de la excepción: System.FormatException: La cadena de entrada no tiene el formato correcto.
Error de código fuente:
Línea 343: ModificacionDatos.UpdateCommand.Parameters("Origin al_OTD").Value = Me.cboOT.SelectedValue
Línea 344: ModificacionDatos.UpdateCommand.Parameters("Origin al_matriculaD").Value = Me.cboDatos.SelectedValue
Línea 345: ModificacionDatos.UpdateCommand.ExecuteNonQuery()
Línea 346: Conexion.Close()
Línea 347: End Sub
Gracias y un saludo. |