Vous êtes sur la page 1sur 6

CONALEP 1

Viridiana Huerta García

6101-I

080260314-2

PSP: Rocio Pinto

PRACTICA #4
Public Class Form1

Private Sub TextBox2_TextChanged(ByVal sender As System.Object,


ByVal e As System.EventArgs) Handles TextBox1.TextChanged

End Sub

Private Sub button1_Click(ByVal sender As System.Object, ByVal e


As System.EventArgs) Handles M.Click
If (TextBox1.Text = "garcia") Then
MsgBox("Bienvenido")
Form2.Show()
Me.Hide()
Else
MsgBox("Contraseña Incorrecta")
End If
End Sub
End Class
Public Class Form2
Dim dt As New DataTable
Dim cn As New
OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=c:viri6101-I\taller.mdb")
Public fila As Integer = 0
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles Button1.Click
Form3.Show()
End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e


As System.EventArgs) Handles Button2.Click
cn.Open()
Form4.Show()

End Sub

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e


As System.EventArgs) Handles Button3.Click

End Sub

Private Sub Button5_Click(ByVal sender As System.Object, ByVal e


As System.EventArgs) Handles Button5.Click

End Sub
End Class
Public Class Form3
Dim dt As New DataTable
Dim cn As New
OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=c:viri6101-I\taller.mdb")
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles Button2.Click
form4.show()
End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e


As System.EventArgs) Handles Button1.Click
cn.open()
Dim GuardarDatos As String = "Insert into
datos(Matricula,engomado,serie,marca,modelo,reparacion)" & "values ('"
& txtmatricula.Text & "','" & Txtengo.Text & "','" & Txtserie.Text &
"','" & Txtmarca.Text & "','" & Txtmodelo.Text & "','" & Txtrepa.Text
& "')"
Dim dataAdapter As New OleDb.OleDbDataAdapter(GuardarDatos,
cn)
dataAdapter.Fill(dt)
MsgBox(" Se agrego el registro correctamente",
MsgBoxStyle.Information, "Mensaje")
cn.close()

End Sub

Private Sub Textmarca_TextChanged(ByVal sender As System.Object,


ByVal e As System.EventArgs) Handles Txtmarca.TextChanged

End Sub

Private Sub Button4_Click(ByVal sender As System.Object, ByVal e


As System.EventArgs) Handles Button4.Click
txtmatricula.Text = ""
Txtengo.Text = ""
Txtserie.Text = ""
Txtmarca.Text = ""
Txtmodelo.Text = ""
Txtrepa.Text = ""

End Sub

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e


As System.EventArgs) Handles Button3.Click
Form2.Show()
End Sub
End Class

Public Class Form4


Dim dt As New DataTable
Dim cn As New
OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=c:viri6101-I\taller.mdb")
Public fila As Integer = 0
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles Button1.Click
Dim ConsultarDatos As String = "Select * From datos "
Dim dataAdapter As New OleDb.OleDbDataAdapter(ConsultarDatos,
cn)
dataAdapter.Fill(dt)
fila = 0
Form3.txtmatricula.Text = CInt(dt.Rows(fila)("matricula"))
Form3.Txtengo.Text = CInt(dt.Rows(fila)("engomado"))
Form3.Txtserie.Text = CInt(dt.Rows(fila)("serie"))
Form3.Txtmarca.Text = CStr(dt.Rows(fila)("marca"))
Form3.Txtmodelo.Text = CInt(dt.Rows(fila)("modelo"))
Form3.Txtrepa.Text = CStr(dt.Rows(fila)("reparacion"))
MsgBox(" se encontro el registro correctamente",
MsgBoxStyle.Information, "Mensaje")
dataAdapter.Dispose()
cn.Close()
End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e


As System.EventArgs) Handles Button2.Click
txtmatricula.Text = ""
Txtengo.Text = ""
Txtserie.Text = ""
Txtmarca.Text = ""
Txtmodelo.Text = ""
Txtrepa.Text = ""

End Sub
End Class

Vous aimerez peut-être aussi