Aplicaciones Asp
Enviado por mariaesteffany • 23 de Noviembre de 2014 • 425 Palabras (2 Páginas) • 133 Visitas
RESULTADO NAVEGADOR
Los Registros Llenados en la BASE DE DATOS se muestran a continuacion:
EL Codigo para la siquiente aplicacion es la siguiente:
Imports System.Data.SqlClient
Partial Public Class _Default
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim conexion As String
conexion = "Data Source=PC-01\SQLSERVER2012;Initial Catalog=xxx;Integrated Security=True"
Dim objconexion As New SqlConnection(conexion)
Dim strSQL1, strSQL2, strSQL3, strSQL4 As String
strSQL1 = "Select Cod_Em,Nom_Em,Ape_Em,Area_Em,Cargo_Em from Empleados where Area_Em in(10,20,30,40)"
strSQL2 = "Select Cod_Em,Nom_Em,Sueldo_Em from Empleados where Sueldo_Em>530 and Sueldo_Em<2000"
strSQL3 = "Select * from Empleados where Fecha_Ing>='01/01/2000'"
strSQL4 = "Select Nom_Em,Ape_Em,Area_Em,Sueldo_Em from Empleados where Ape_Em like'W%'"
Dim objcommand1 As New SqlCommand(strSQL1, objconexion)
Dim objcommand2 As New SqlCommand(strSQL2, objconexion)
Dim objcommand3 As New SqlCommand(strSQL3, objconexion)
Dim objcommand4 As New SqlCommand(strSQL4, objconexion)
Dim objadapter1, objadapter2, objadapter3, objadapter4 As New SqlDataAdapter
objadapter1.SelectCommand = objcommand1
objadapter2.SelectCommand = objcommand2
objadapter3.SelectCommand = objcommand3
objadapter4.SelectCommand = objcommand4
objconexion.Open()
Dim objds1, objds2, objds3, objds4 As New DataSet
objadapter1.Fill(objds1, "Empleados")
objadapter2.Fill(objds2, "Empleados")
objadapter3.Fill(objds3, "Empleados")
objadapter4.Fill(objds4, "Empleados")
objconexion.Close()
GD1.DataSource = objds1
GD2.DataSource = objds2
GD3.DataSource = objds3
GD4.DataSource = objds4
GD1.DataBind()
GD2.DataBind()
GD3.DataBind()
GD4.DataBind()
End Sub
End Class
TAREA : REALIZAR ALGUNAS CONSULTAS DADAS POR EL DOCENTE PARA LA PARTE PRACTICA.
...