Ver Mensaje Individual
  #2 (permalink)  
Antiguo 28/09/2010, 15:24
koke84
 
Fecha de Ingreso: septiembre-2010
Mensajes: 4
Antigüedad: 14 años, 6 meses
Puntos: 0
Respuesta: Error al actualizar la fecha

Hola disculpen el doble post, pero ya solucione el problema saque el codigo del load y lo puse en el boton y funciono sin ningun problema. Les dejo el codigo por si alguien le sirve

Código vb:
Ver original
  1. Private Sub Button9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button9.Click
  2.         ooConexion = New SqlConnection
  3.         ooConexion.ConnectionString = _
  4.         "Data Source=SISTEMAS; database=DOP; user id=administrador;password=napoleon"
  5.         oDataAdapter = New SqlDataAdapter
  6.         Dim sSQL As String
  7.         sSQL = "update decreto set fecha_llegada = '" & MaskedTextBox1.Text & "'" & _
  8.                                        "where Decreto_OP= '" & TextBox3.Text & "'"
  9.  
  10.         'crear comando
  11.        Dim oComando As New SqlCommand(sSQL, ooConexion)
  12.         oComando.Parameters.Add(New SqlParameter("@Fecha_Llegada", _
  13.         SqlDbType.DateTime))
  14.         oComando.Parameters("@Fecha_Llegada").Value = Me.MaskedTextBox1.Text
  15.        
  16.         Dim iResultado As Integer
  17.  
  18.         ooConexion.Open() ' abrir conexión
  19.        iResultado = oComando.ExecuteNonQuery() ' ejecutar comando
  20.        LimpiarDatos()
  21.         ooConexion.Close() ' cerrar conexión
  22.        MessageBox.Show("Registros modificados Correctamente:" & iResultado)
  23.  
  24.     End Sub

gracias de todas formas
saludos Jorge