Vous êtes sur la page 1sur 5

Practica Nº22

12 de
nov.

Practica Nº22

Programación Con Sistemas Gestores De


Bases De Datos

Ing. Sergio González Pérez

Santiago Antonio Gaytan Piña

080260173-2

5101- I

12 de Noviembre de 2010

1
Practica Nº22
12 de
nov.

Lista de Cotejo

Práctica # 22 Manejo de estructuras de repetición en


ordenamiento

Nombre de la Materia: Plantel: Conalep Juárez I


Programación Básica
Instructor: Ing. Sergio González Pérez Grupo: 5101

Alumno: Santiago Antonio Gaytan Piña Fecha de aplicación : 9/ Noviembre / 2010

INSTRUCCIONES DE APLICACIÓN.
Verifique que se encuentren los componentes señalados abajo y marque con una √ el registro
de cumplimiento correspondiente.

DESARROLLO
REGISTRO DE

No Características a verificar CUMPLIMIENTO OBSERVACIONES


SI NO
1 Inicia el Sistema Gestor de Base de Datos ♫
2 Abre la Base de Datos que será utilizada ♫
3 Realiza los pasos de la practica ♫
4 Manipula correctamente el SGBD ♫
5 Almacena en su carpeta las actividades planteadas ♫
6 Realiza el reporte del resultado del programa. ♫

REGISTRO DE

No Actividades a desarrollar CUMPLIMIENTO OBSERVACIONES


SI NO
1 Inicializa Lenguaje de Programación ♫
2 Agrega Formulario ♫
3 Diseña los Controles del Formulario ♫
4 Realiza Código de Ordenamiento Numérico ♫

Firma del Alumnos Firma del Instructor

2
Practica Nº22
12 de
nov.
Practica Nº22
Manejo de estructuras de repetición en ordenamiento

FORMULARIO

Botón consultar
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
cn.Open()
Dim mostrardatos As String = "Select * from Fechas"
Dim dataAdapter As New OleDb.OleDbDataAdapter(mostrardatos, cn)
dataAdapter.Fill(dt)
For fila = 0 To dt.Rows.Count - 1
Actualiza()
Next
dataAdapter.Dispose()
cn.Close()
End Sub

Función actualiza
Public Sub Actualiza()
ListBox1.Items.Add(Int(dt.Rows(fila)("d")))
ListBox2.Items.Add(Int(dt.Rows(fila)("m")))
ListBox3.Items.Add(Int(dt.Rows(fila)("a")))
End Sub

Botón fecha seleccionada


Private Sub Button2_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles Button2.Click
Label4.Text = Str(ListBox1.SelectedItem)
Select Case Int(ListBox2.SelectedItem)
Case 1
Label4.Text = Label4.Text + " de Enero de "
Case 2
Label4.Text = Label4.Text + " de Febrero de "
Case 3
Label4.Text = Label4.Text + " de Marzo de "
Case 4
Label4.Text = Label4.Text + " de Abril de "
Case 5
Label4.Text = Label4.Text + " de Mayo de "
Case 6

3
Practica Nº22
12 de
nov.
Label4.Text = Label4.Text + " de Junio de "
Case 7
Label4.Text = Label4.Text + " de Julio de "
Case 8
Label4.Text = Label4.Text + " de Agosto de "
Case 9
Label4.Text = Label4.Text + " de Septiembre de "
Case 10
Label4.Text = Label4.Text + " de Octubre de "
Case 11
Label4.Text = Label4.Text + " de Noviembre de "
Case 12
Label4.Text = Label4.Text + " de Diciembre de "
End Select
Label4.Text = Label4.Text + Str(ListBox3.SelectedItem)
End Sub

Botones Ordenar
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles Button3.Click
Dim x As Integer
Dim a(ListBox1.Items.Count) As Integer
Dim y As Integer
Dim temp As Integer
For x = 0 To ListBox1.Items.Count - 1
a(x) = ListBox1.Items(x)
Next x
y = 0
For x = 0 To ListBox1.Items.Count - 1
For y = 0 To ListBox1.Items.Count - 1
If (a(y) > a(y + 1)) Then
temp = a(y + 1)
a(y + 1) = a(y)
a(y) = temp
End If
Next
Next
ListBox1.Items.Clear()
For x = 1 To 6
ListBox1.Items.Add(a(x))
Next
End Sub

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


As System.EventArgs) Handles Button4.Click
Dim x As Integer
Dim a(ListBox2.Items.Count) As Integer
Dim y As Integer
Dim temp As Integer
For x = 0 To ListBox2.Items.Count - 1
a(x) = ListBox2.Items(x)
Next x
y = 0
For x = 0 To ListBox2.Items.Count - 1
For y = 0 To ListBox2.Items.Count - 1
If (a(y) > a(y + 1)) Then
temp = a(y + 1)
a(y + 1) = a(y)
a(y) = temp
End If
Next

4
Practica Nº22
12 de
nov.
Next
ListBox2.Items.Clear()
For x = 1 To 6
ListBox2.Items.Add(a(x))
Next
End Sub

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


As System.EventArgs) Handles Button5.Click
Dim x As Integer
Dim a(ListBox3.Items.Count) As Integer
Dim y As Integer
Dim temp As Integer
For x = 0 To ListBox3.Items.Count - 1
a(x) = ListBox3.Items(x)
Next x
y = 0
For x = 0 To ListBox3.Items.Count - 1
For y = 0 To ListBox3.Items.Count - 1
If (a(y) > a(y + 1)) Then
temp = a(y + 1)
a(y + 1) = a(y)
a(y) = temp
End If
Next
Next
ListBox3.Items.Clear()
For x = 1 To 6
ListBox3.Items.Add(a(x))
Next
End Sub
End Class

Formulario consultar

Formulario Ordenado

Vous aimerez peut-être aussi