Advertisement
Guest User

Untitled

a guest
Jul 15th, 2019
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.10 KB | None | 0 0
  1. DateTime datetime1 = Convert.ToDateTime(NIVigencia.Text);
  2. DateTime datetime2 = Convert.ToDateTime(NFVigencia.Text);
  3. DateTime datetime3 = Convert.ToDateTime(fechahoy.Text);
  4.  
  5. String ActualizarDS1 = "Update DATOSSEGURO SET Poliza = '" + NuevaPoliza.Text + "', Aseguradora = '" + Naseguradora.Text + "', FechaColozacion = '" + datetime3 + "', InitVigencia = '" + datetime1+ "', FinVigencia = '" + datetime2+ "' WHERE Poliza = " + TBPoliza.Text;
  6. SqlCommand actualizar = new SqlCommand();
  7. actualizar.Connection = MenuInicio.conexion;
  8. actualizar.CommandType = CommandType.Text;
  9. actualizar.CommandText = ActualizarDS1;
  10. try
  11. {
  12. actualizar.ExecuteNonQuery();
  13. actualizar.Dispose();
  14. actualizar = null;
  15. MessageBox.Show("Nueva Poliza agregada con exito", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
  16. }
  17. catch (SqlException ex)
  18. {
  19. MessageBox.Show("ERROR al actualizar datosseguro :" + ex.Message, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error);
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement