Академический Документы
Профессиональный Документы
Культура Документы
BtnGuardar.Click
Dim consulta As String
Dim guardar As New OleDb.OleDbCommand
consulta
TxtApellido.Text
TxtNoCasa.Text &
TxtNumero.Text &
")"
guardar.CommandType = CommandType.Text
guardar.Connection = s
guardar.CommandText = consulta
Try
guardar.ExecuteNonQuery()
MsgBox("Datos Guardos")
Catch ex As Exception
MsgBox("Datos no guardados")
End Try
End Sub
Private Sub BtnEliminar_Click(sender As Object, e As EventArgs) Handles
BtnEliminar.Click
Dim x As String
Dim y As New OleDb.OleDbCommand
x = "DELETE * FROM CIUDADANO WHERE CODIGO=" & TxtCodigo.Text
y.CommandType = CommandType.Text
y.Connection = s
y.CommandText = x
If MsgBox("Desea eliminar", vbYesNo, "") = vbYes Then
Try
y.ExecuteNonQuery()
MsgBox("Datos eliminados")
TxtCodigo.Clear()
TxtApellido.Clear()
TxtNombre.Clear()
TxtCalle.Clear()
TxtNoCasa.Clear()
TxtZona.Clear()
TxtCodigoMuni.Clear()
TxtNumero.Clear()
TxtEmpresa.Clear()
TxtNivel.Clear()
TxtCodigo.Focus()
DTP1.Text = ""
Catch ex As Exception
MsgBox("Dato no encontrado")
End Try
End If
End Sub
", NOTELMOVIL=" & TxtNumero.Text & ", EMPRESACEL=" & TxtEmpresa.Text & ", FECHANAC="
& DTP1.Value & ", NIVEL_ACADEMICO=" & TxtNivel.Text & " WHERE CODIGO=" &
TxtCodigo.Text
y.CommandType = CommandType.Text
y.Connection = s
y.CommandText = x
If MsgBox("Desea modificar el campo(s)", vbYesNo, "") = vbYes Then
Try
y.ExecuteNonQuery()
MsgBox("Datos modificados")
TxtCodigo.Clear()
TxtApellido.Clear()
TxtNombre.Clear()
TxtCalle.Clear()
TxtNoCasa.Clear()
TxtZona.Clear()
TxtCodigoMuni.Clear()
TxtNumero.Clear()
TxtEmpresa.Clear()
TxtNivel.Clear()
DTP1.Text = ""
TxtCodigo.Focus()
Catch ex As Exception
MsgBox("Datos no encontrados")
End Try
Else
TxtCodigo.Clear()
TxtApellido.Clear()
TxtNombre.Clear()
TxtCalle.Clear()
TxtNoCasa.Clear()
TxtZona.Clear()
TxtCodigoMuni.Clear()
TxtNumero.Clear()
TxtEmpresa.Clear()
TxtNivel.Clear()
DTP1.Text = ""
TxtCodigo.Focus()
End If
End Sub
Private Sub BtnCerrar_Click(sender As Object, e As EventArgs) Handles
BtnCerrar.Click
If MsgBox("Desea cerrar", vbYesNo) = vbYes Then
Me.Close()
Else
MsgBox("Puede continuar")
End If
End Sub
End Class