Está en la página 1de 3

Colegio Nacional de Educació n Técnica del Estado de Chihuahua

“Elaboració n y Mantenimiento de Sistemas de Informació n”

Practica #3

PSP: Ing. Roció Pinto

Miriam Flores Gonzá lez

6101-I

6101-I 080260565-9
Boton consultar
cn.Open()
Dim ConsultarDatos As String = "Select*From Numero_alumno Where
Numero_alumno=" & (CInt(txt1.Text))
Dim dataAdapter As New OleDb.OleDbDataAdapter(ConsultarDatos, cn)
dataAdapter.Fill(dt)
fila = 0
txt1.Text = CInt(dt.Rows(fila)("Numero_alumno"))
txt2.Text = CStr(dt.Rows(fila)("Nombre_alumno"))
txt3.Text = CStr(dt.Rows(fila)("Direccion"))
txt4.Text = CStr(dt.Rows(fila)("Telefono"))
txt5.Text = CStr(dt.Rows(fila)("Clase"))
MsgBox(" se encontro el registro correctamente",
MsgBoxStyle.Information, "mensaje")
dataAdapter.Dispose()
cn.Close()

Boton agregar
Dim GuardarDatos As String = "Insert into Fecha
(Numero_alumno,Nombre_alumno,Direccion,Telefono,Clase)" &
"values ('" & txt1.Text & "','" & txt2.Text & "','" &
txt3.Text & "','" & txt4.Text & "','" & txt5.Text & "')"

Boton modificar
cn.Open()
dim modificarDatos as string= "Update Alumnos set
Numero_alumno='"&txt1&"',Nombre_alumno='"&txt2&"',Numero_alumno='"&txt3.t
ext&"',Nombre_alumno="'&txt4&'",Direccion='"&txt5.text&"',Clase='"&txt5&'
", where Numero_alumno&"="& CInt(txt.Numero_alumno))"
Dim dataAdapter As New OleDb.OleDbDataAdapter(ModificarDatos, cn)
dataAdapter.Fill(dt)
txt1.Text = CInt(dt.Rows(fila)("Numero_alumno"))
txt2.Text = CInt(dt.Rows(fila)("Nombre_alumno"))
txt3.Text = CInt(dt.Rows(fila)("Direccion"))
txt4.Text = CInt(dt.Rows(fila)("Telefono"))
txt5.Text = CInt(dt.Rows(fila)("Clase"))

MsgBox("rejistro modificado correctamente")


cn.Close()

Boton Borrar
Dim BorrarDatos As String = "Deleate*from Alumnos where Numero_alumno=" &
CInt(txt1.Text)
Dim dataAdapter As New OleDb.OleDbDataAdapter(BorrarDatos, cn)
dataAdapter.Fill(dt)
refrescar()
actualizar()
dataAdapter.Dispose()
cn.Close()

También podría gustarte