1c:usershpcompdocumentsvisual studio 2012ProjectscarnetcarnetForm1.vb
Imports System.Data.SqlClient
Public Class Form1
Private oDataAdapter As SqlDataAdapter
Private oDataset As DataSet
Private iPosicFilaActual As Integer
Dim CC As SqlConnection
Private Sub btnmostrar_Click(sender As Object, e As EventArgs) Handles btnmostrar.Click
cc = New SqlConnection
cc.connectionString = My.MySettings.Default.CadenaConexion
Dim oComando As New sqlComand("exec buscar'" + Trim(txtcarnet) + "'", cc)
'crear datareader
Dim oDatareader As SqlDataReader cc.open()
oDataReader = oComando.ExecuteReader() 'obtener datareader
'recorer filas
While oDatareader.Read()
Me.txtnombres.AppendText(Trim(oDataReader("Nombres")))
Me.txtapellidos.AppendText(Trim(oDatareader("apellidos")))
Me.txtemail.AppendText(Trim(oDataReader("email")))
Me.txttelefono.AppendText(Trim(oDatareader("telefono")))
Me.txtdireccion.AppendText(Trim(oDatareader("direccion")))
End While
oDatareader.close()
CChar.close()
End Sub
Private Sub btnagregar_Click(sender As Object, e As EventArgs) Handles btnagregar.Click
habilitar()
End Sub
Private Sub btnguardar_Click(sender As Object, e As EventArgs) Handles btnguardar.Click
Dim oConexion As SqlConnection
oConexion = New SqlConnection
oConexion.ConnectionString = My.MySettings.Default.cadenaconeccion
Me.oDataAdapter = New SqlDataAdapter("select * from datos", oConexion)
Dim oCommBuild As SqlCommandBuilder = New SqlCommandBuilder(oDataAdapter)
Me.oDataSet=New DataSet oConexion.open()
End Sub
End Class
Private Sub habilitar()
txtapellidos.enabled = True
txtnombres.enabled = True
txtcarnet.enabled = True
txtdireccion.enabled = True
txtemail.enabled = True
txttelefono.enabled = True
txtapellidos.text = ""
txtnombres.text = ""
txtcarnet.text = ""
txtdireccion.text = ""
txtemail.text = ""
txttelefono = ""
End Sub

More Related Content

PDF
Fetch data from form
PPTX
Simple.Data intro slides
PDF
Excel to Use Rest API to communicate with a server
PPTX
Introduction to MongoDB
PDF
Git as NoSQL
DOCX
Kode vb.net
PPT
Asp db
PDF
Sistema de ventas
Fetch data from form
Simple.Data intro slides
Excel to Use Rest API to communicate with a server
Introduction to MongoDB
Git as NoSQL
Kode vb.net
Asp db
Sistema de ventas

What's hot (20)

PPTX
Goa tutorial
PDF
Pymongo for the Clueless
DOC
Quanlycanbo
PDF
Vb Project ขั้นเทพ
TXT
Vb database connections
PPTX
Cnam azure 2014 mobile services
PPTX
Mongo db updatedocumentusecases
PDF
Do something in 5 with gas 9-copy between databases with oauth2
PPTX
Html web sql database
PPTX
Engaging users with live tiles and notifications
PDF
Tools and Projects Dec 2018 Edition
TXT
New text document
DOC
1 serializando y deserializando datos en red
PDF
PDF
VBA API for scriptDB primer
PPTX
Windows ストアーアプリで SQLite を使ってみよう
PDF
Do something useful in Apps Script 5. Get your analytics pageviews to a sprea...
PPT
Play With Theschwartz
PPTX
Event-Driven Systems With MongoDB
PDF
“iOS 11 в App in the Air”, Пронин Сергей, App in the Air
Goa tutorial
Pymongo for the Clueless
Quanlycanbo
Vb Project ขั้นเทพ
Vb database connections
Cnam azure 2014 mobile services
Mongo db updatedocumentusecases
Do something in 5 with gas 9-copy between databases with oauth2
Html web sql database
Engaging users with live tiles and notifications
Tools and Projects Dec 2018 Edition
New text document
1 serializando y deserializando datos en red
VBA API for scriptDB primer
Windows ストアーアプリで SQLite を使ってみよう
Do something useful in Apps Script 5. Get your analytics pageviews to a sprea...
Play With Theschwartz
Event-Driven Systems With MongoDB
“iOS 11 в App in the Air”, Пронин Сергей, App in the Air

Viewers also liked (9)

PDF
Consulta in
PPTX
Eliminación archivos temporales viernes a las 15h
PDF
Instalar sql server 2008 r2 y analysis services en un failover cluster de win...
DOC
Procedimientos Almacenados
DOC
Sql procedimientos-almacenados
PPTX
Procedimientos Almacenados
PDF
Ejercicios resueltos de sql
PPT
Consultas base de datos en SQL
PDF
MANUAL COMPLETO DE SQL
Consulta in
Eliminación archivos temporales viernes a las 15h
Instalar sql server 2008 r2 y analysis services en un failover cluster de win...
Procedimientos Almacenados
Sql procedimientos-almacenados
Procedimientos Almacenados
Ejercicios resueltos de sql
Consultas base de datos en SQL
MANUAL COMPLETO DE SQL

Similar to Form1.vb (20)

PDF
Visual Studio.Net - Sql Server
PPTX
76.pptx ajx ppt file for univercity of granted
DOCX
Codes
PDF
Euruko 2009 - DataObjects
DOCX
Kode vb.net
PDF
The Ring programming language version 1.8 book - Part 34 of 202
PDF
The Ring programming language version 1.6 book - Part 31 of 189
PDF
Sistemadeventas 100707084319-phpapp01
TXT
Tipo virus espia con esto aprenderan a espiar a personas etc jeropas de mrd :v
PDF
DOT NET LAB PROGRAM PERIYAR UNIVERSITY
PDF
SISTEMA DE FACTURACION (Ejemplo desarrollado)
PDF
The Ring programming language version 1.9 book - Part 53 of 210
PDF
Imports System.Net.Sockets Imports System.Text Public Class Form1 .pdf
PDF
The Ring programming language version 1.6 book - Part 46 of 189
PDF
Imports System.Data.OleDb Public Class Form1 Dim connc As Ne.pdf
PDF
The Ring programming language version 1.2 book - Part 32 of 84
PDF
The Ring programming language version 1.7 book - Part 32 of 196
PDF
Aplikasi rawat-inap-vbnet
PDF
The Ring programming language version 1.4.1 book - Part 13 of 31
Visual Studio.Net - Sql Server
76.pptx ajx ppt file for univercity of granted
Codes
Euruko 2009 - DataObjects
Kode vb.net
The Ring programming language version 1.8 book - Part 34 of 202
The Ring programming language version 1.6 book - Part 31 of 189
Sistemadeventas 100707084319-phpapp01
Tipo virus espia con esto aprenderan a espiar a personas etc jeropas de mrd :v
DOT NET LAB PROGRAM PERIYAR UNIVERSITY
SISTEMA DE FACTURACION (Ejemplo desarrollado)
The Ring programming language version 1.9 book - Part 53 of 210
Imports System.Net.Sockets Imports System.Text Public Class Form1 .pdf
The Ring programming language version 1.6 book - Part 46 of 189
Imports System.Data.OleDb Public Class Form1 Dim connc As Ne.pdf
The Ring programming language version 1.2 book - Part 32 of 84
The Ring programming language version 1.7 book - Part 32 of 196
Aplikasi rawat-inap-vbnet
The Ring programming language version 1.4.1 book - Part 13 of 31

More from Like Music (20)

PDF
Cómo instalar android en una máquina virtual virtual box
PDF
Listado de puertos de internet puertosabiertos.com
PDF
Hojademetods
PDF
Fragment text
PDF
40786151 tutorial-de-sql-server-2005
PDF
Analisis de producto
DOCX
Document analisis corto
DOCX
Documento de forma compacta
DOCX
Documento creacion de bases de datos
DOCX
Documento de forma compacta
DOCX
Documento relaciones
DOCX
Tabla
DOCX
Docuemento de funcion
PPTX
Conexion correct appshome
PPTX
Second source appshome
PPTX
Screen development applicationshome
PPTX
Consideracionesformularios
PDF
Diag recticular desig
PPTX
Store procedure
PPTX
Store procedure
Cómo instalar android en una máquina virtual virtual box
Listado de puertos de internet puertosabiertos.com
Hojademetods
Fragment text
40786151 tutorial-de-sql-server-2005
Analisis de producto
Document analisis corto
Documento de forma compacta
Documento creacion de bases de datos
Documento de forma compacta
Documento relaciones
Tabla
Docuemento de funcion
Conexion correct appshome
Second source appshome
Screen development applicationshome
Consideracionesformularios
Diag recticular desig
Store procedure
Store procedure

Recently uploaded (20)

PDF
Q1-wK1-Human-and-Cultural-Variation-sy-2024-2025-Copy-1.pdf
PPT
Technicalities in writing workshops indigenous language
PDF
PPT nikita containers of the company use
PPTX
Bussiness Plan S Group of college 2020-23 Final
PPTX
Fkrjrkrkekekekeekkekswkjdjdjddwkejje.pptx
PPTX
Basic Statistical Analysis for experimental data.pptx
PDF
TenneT-Integrated-Annual-Report-2018.pdf
PPTX
reflex-210317162019.pptxjy5i767i6i67i67i67i76
PPTX
cardiac failure and associated notes.pptx
PDF
The-Physical-Self.pdf college students1-4
PDF
Nucleic-Acids_-Structure-Typ...-1.pdf 011
PPTX
An Introduction to Lean Six Sigma for Bilginer
PPT
Drug treatment of Malbbbbbhhbbbbhharia.ppt
PDF
Book Trusted Companions in Delhi – 24/7 Available Delhi Personal Meeting Ser...
PPTX
Power BI - Microsoft Power BI is an interactive data visualization software p...
PDF
n8n Masterclass.pdfn8n Mastercn8n Masterclass.pdflass.pdf
PPTX
REAL of PPT_P1_5019211081 (1).pdf_20250718_084609_0000.pptx
PDF
NU-MEP-Standards معايير تصميم جامعية .pdf
PPT
DWDM unit 1 for btech 3rd year students.ppt
PPTX
Transport System for Biology students in the 11th grade
Q1-wK1-Human-and-Cultural-Variation-sy-2024-2025-Copy-1.pdf
Technicalities in writing workshops indigenous language
PPT nikita containers of the company use
Bussiness Plan S Group of college 2020-23 Final
Fkrjrkrkekekekeekkekswkjdjdjddwkejje.pptx
Basic Statistical Analysis for experimental data.pptx
TenneT-Integrated-Annual-Report-2018.pdf
reflex-210317162019.pptxjy5i767i6i67i67i67i76
cardiac failure and associated notes.pptx
The-Physical-Self.pdf college students1-4
Nucleic-Acids_-Structure-Typ...-1.pdf 011
An Introduction to Lean Six Sigma for Bilginer
Drug treatment of Malbbbbbhhbbbbhharia.ppt
Book Trusted Companions in Delhi – 24/7 Available Delhi Personal Meeting Ser...
Power BI - Microsoft Power BI is an interactive data visualization software p...
n8n Masterclass.pdfn8n Mastercn8n Masterclass.pdflass.pdf
REAL of PPT_P1_5019211081 (1).pdf_20250718_084609_0000.pptx
NU-MEP-Standards معايير تصميم جامعية .pdf
DWDM unit 1 for btech 3rd year students.ppt
Transport System for Biology students in the 11th grade

Form1.vb

  • 1. 1c:usershpcompdocumentsvisual studio 2012ProjectscarnetcarnetForm1.vb Imports System.Data.SqlClient Public Class Form1 Private oDataAdapter As SqlDataAdapter Private oDataset As DataSet Private iPosicFilaActual As Integer Dim CC As SqlConnection Private Sub btnmostrar_Click(sender As Object, e As EventArgs) Handles btnmostrar.Click cc = New SqlConnection cc.connectionString = My.MySettings.Default.CadenaConexion Dim oComando As New sqlComand("exec buscar'" + Trim(txtcarnet) + "'", cc) 'crear datareader Dim oDatareader As SqlDataReader cc.open() oDataReader = oComando.ExecuteReader() 'obtener datareader 'recorer filas While oDatareader.Read() Me.txtnombres.AppendText(Trim(oDataReader("Nombres"))) Me.txtapellidos.AppendText(Trim(oDatareader("apellidos"))) Me.txtemail.AppendText(Trim(oDataReader("email"))) Me.txttelefono.AppendText(Trim(oDatareader("telefono"))) Me.txtdireccion.AppendText(Trim(oDatareader("direccion"))) End While oDatareader.close() CChar.close() End Sub Private Sub btnagregar_Click(sender As Object, e As EventArgs) Handles btnagregar.Click habilitar() End Sub Private Sub btnguardar_Click(sender As Object, e As EventArgs) Handles btnguardar.Click Dim oConexion As SqlConnection oConexion = New SqlConnection oConexion.ConnectionString = My.MySettings.Default.cadenaconeccion Me.oDataAdapter = New SqlDataAdapter("select * from datos", oConexion) Dim oCommBuild As SqlCommandBuilder = New SqlCommandBuilder(oDataAdapter) Me.oDataSet=New DataSet oConexion.open() End Sub End Class Private Sub habilitar() txtapellidos.enabled = True txtnombres.enabled = True txtcarnet.enabled = True txtdireccion.enabled = True txtemail.enabled = True txttelefono.enabled = True txtapellidos.text = "" txtnombres.text = "" txtcarnet.text = "" txtdireccion.text = "" txtemail.text = "" txttelefono = "" End Sub