0% found this document useful (0 votes)
28 views2 pages

Practica 3

This document contains code snippets for different database operations - consulting, adding, accessing, deleting - on a table called Almacen using ADO.NET and OleDb. It includes code to open a connection, fill a data table, display messages, and close the connection. User authentication is also demonstrated via a password check.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views2 pages

Practica 3

This document contains code snippets for different database operations - consulting, adding, accessing, deleting - on a table called Almacen using ADO.NET and OleDb. It includes code to open a connection, fill a data table, display messages, and close the connection. User authentication is also demonstrated via a password check.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Colegio nacional de educación profesional técnica

Materia: Elaboración y mantenimiento de sistemas

Alumno: Emmanuel rocha rosales

Matricula: 080260692-1

Grupo: 6101

PSP: Ing. Roció pinto muñoz

Fecha: 13/03/2011
Opciones:

Consultar:

cn.Open()
Dim MostrarDatos As String = "Select * From Almacen"
Dim dataAdapter As New OleDb.OleDbDataAdapter(MostrarDatos, cn)
dataAdapter.Fill(dt)
Actualiza()
dataAdapter.Dispose()
cn.Close()

Agregar:

Dim GuardarDatos As String = "Insert into Entradas(Nuevo, NoHerramientas)" &


"Values ('" & TextBox1.Text & "','" & TextBox2.Text & "')"
Dim DataAdapter As New OleDb.OleDbDataAdapter(GuardarDatos, cn)
DataAdapter.Fill(dt)
MsgBox("Se a guardado con exito")
DataAdapter.Dispose()
cn.Close()

Contraseña:

If (TextBox1.Text = "canaca5") Then


MsgBox("Bienvenido")
Me.Hide()
Form2.ShowDialog()
Else
MsgBox("Contraseña incorrecta")
End If

Acceder:

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


System.EventArgs) Handles Button1.Click
altas.Show()
Me.Close()
End Sub

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


System.EventArgs) Handles Button2.Click
bajas.Show()
Me.Close()
End Sub

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


System.EventArgs) Handles Button3.Click
almacen.Show()
Me.Close()
End Sub

Borrar:

Dim Borrardatos As String = "delete * from Registros where "


Inventario= " & CStr(TextBox1.Text)"
Dim dataAdapter As New OleDb.OleDbDataAdapter(Borrardatos, cn)
dataAdapter.Fill(dt)
MsgBox("se elimino el registro")
refrescar()
Actualiza()
dataAdapter.Dispose()
cn.Close()

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy