Abc De Vase De Datos A Visual.Net 2000

Páginas: 3 (647 palabras) Publicado: 5 de diciembre de 2012
Imports System.Data.SqlClient

Public Class Form1
Inherits System.Windows.Forms.Form
Private oConexion As SqlConnection
Private oDataSet As DataSet
Private oDataAdapter AsSqlDataAdapter


Private Sub Label1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label1.Click

End Sub

Private Sub Form1_Load(ByVal sender AsSystem.Object, ByVal e As System.EventArgs) Handles MyBase.Load
' crear conexión
oConexion = New SqlConnection
oConexion.ConnectionString = ("datasource=I-D9EE060EFA434\SQLEXPRESS; initial catalog=AHO;integrated security=true")
' crear adaptador
oDataAdapter = New SqlDataAdapter
' crear comandos para inserción, consulta con sus parámetros' y asignarlos al adaptador


Dim oCmdConsulta As New SqlCommand("SELECT * FROM EMPLEADOS", oConexion)
oDataAdapter.SelectCommand = oCmdConsulta

DimoCmdInsercion As New SqlCommand("INSERT INTO EMPLEADOS(ID_EMPLEADO,NOMBRE,APP,APM,DIRECCION,CIUDAD) VALUES(@ID_EMPLEADO,@NOMBRE,@APP,@APM,@DIRECCION,@CIUDAD)", oConexion)
oDataAdapter.InsertCommand= oCmdInsercion
oDataAdapter.InsertCommand.Parameters.Add(New SqlParameter("@ID_EMPLEADO", SqlDbType.NVarChar))
oDataAdapter.InsertCommand.Parameters.Add(NewSqlParameter("@NOMBRE", SqlDbType.NVarChar))
oDataAdapter.InsertCommand.Parameters.Add(New SqlParameter("@APP", SqlDbType.NVarChar))
oDataAdapter.InsertCommand.Parameters.Add(NewSqlParameter("@APM", SqlDbType.NVarChar))
oDataAdapter.InsertCommand.Parameters.Add(New SqlParameter("@DIRECCION", SqlDbType.NVarChar))
oDataAdapter.InsertCommand.Parameters.Add(NewSqlParameter("@CIUDAD", SqlDbType.NVarChar))

Dim oCmdDelete As New SqlCommand("DELETE FROM EMPLEADOS WHERE ID_EMPLEADO=@ID_EMPLEADO", oConexion)
oDataAdapter.DeleteCommand = oCmdDelete...
Leer documento completo

Regístrate para leer el documento completo.

Estos documentos también te pueden resultar útiles

  • Datos Abc
  • Datos Economias 2000-2010
  • ABC PROTECCIÓN DE DATOS
  • ABC DE LA PROTECCION DE DATOS
  • Visual.Net
  • Visual.net
  • Visual.Net
  • Data Minning The Insurance Company (Tic) 2000

Conviértase en miembro formal de Buenas Tareas

INSCRÍBETE - ES GRATIS