-->

martes, 31 de mayo de 2011

EJERCIO EN CLASE

EJERCICIO EN VISUAL BASIC CONECTANDO A BASE DE DATOS

Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim cnn As New OleDb.OleDbConnection
        Dim dt As New DataTable
        Dim da As New OleDb.OleDbDataAdapter
        Dim cmd As New OleDb.OleDbCommand
        cnn.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Users\Wz\Documents\futbol.accdb; Persist Security info=false"

        cnn.Open()
        Dim sql As String
        sql = " insert into jugadores(cedula,nombre,apodo,direccion,telefono)" &
            " values ( '" & TextBox1.Text & "','" & TextBox2.Text & "','" & TextBox3.Text & "' ,'" & TextBox4.Text & "','" & TextBox5.Text & "' ) "

        Dim cdo As New OleDb.OleDbCommand(sql, cnn)
        cdo.ExecuteNonQuery()
    End Sub
End Class

































jueves, 26 de mayo de 2011

EJERCICIOS EN CLASE

EJERCICIOS EN CLASE
UTILIZANDO LISTBOX
ublicClassForm1

PrivateSub Form1_Load(ByVal sender AsSystem.Object, ByVal e AsSystem.EventArgs) HandlesMyBase.Load
ListBox1.Items.Add("pedro")
ListBox1.Items.Add("juan")
ListBox1.Items.Add("jose")
ListBox1.Items.Add("maria")
ListBox1.Items.Add("nathalia")
ListBox1.Items.Add("sofia")
EndSub

PrivateSub TextBox1_TextChanged(ByVal sender AsSystem.Object, ByVal e AsSystem.EventArgs) Handles TextBox1.TextChanged

EndSub

PrivateSub ListBox1_SelectedIndexChanged(ByVal sender AsSystem.Object, ByVal e AsSystem.EventArgs) Handles ListBox1.SelectedIndexChanged
        TextBox1.Text = ("pedro")
        TextBox1.Text = ("juan")
        TextBox1.Text = ("jose")
        TextBox1.Text = ("maria")
        TextBox1.Text = ("nathalia")
        TextBox1.Text = ("sofia")
        TextBox1.Text = ListBox1.SelectedItem
EndSub
EndClass




CONECTANDO BASE DE DATOS
       CON VISUAL BASIC


 

UTILIZANDO LIST BOX

OTRO EJERCICIO EN CLASE
PublicClassForm1

PrivateSub ListBox1_SelectedIndexChanged(ByVal sender AsSystem.Object, ByVal e As System.EventArgs) Handles ListBox1.SelectedIndexChanged

EndSub

PrivateSub Button1_Click(ByVal sender AsSystem.Object, ByVal e As System.EventArgs) Handles Button1.Click

listbox1.Items.Add(TextBox1.Text)



EndSub

PrivateSub Button2_Click(ByVal sender AsSystem.Object, ByVal e As System.EventArgs) Handles Button2.Click

ListBox2.Items.RemoveAt(TextBox2.Text)
EndSub

PrivateSub Button3_Click(ByVal sender AsSystem.Object, ByVal e As System.EventArgs) Handles Button3.Click
ListBox2.Items.Add(ListBox1.SelectedItem)

EndSub

PrivateSub Button4_Click(ByVal sender AsSystem.Object, ByVal e As System.EventArgs) Handles Button4.Click
ListBox1.Items.Add(ListBox2.SelectedItem)
EndSub
EndClass







PublicClassForm1

PrivateSub ListBox1_SelectedIndexChanged(ByVal sender AsSystem.Object, ByVal e As System.EventArgs) Handles ListBox1.SelectedIndexChanged

EndSub

PrivateSub Button1_Click(ByVal sender AsSystem.Object, ByVal e As System.EventArgs) Handles Button1.Click

listbox1.Items.Add(TextBox1.Text)



EndSub

PrivateSub Button2_Click(ByVal sender AsSystem.Object, ByVal e As System.EventArgs) Handles Button2.Click

ListBox2.Items.RemoveAt(TextBox2.Text)
EndSub

PrivateSub Button3_Click(ByVal sender AsSystem.Object, ByVal e As System.EventArgs) Handles Button3.Click
ListBox2.Items.Add(ListBox1.SelectedItem)

EndSub

PrivateSub Button4_Click(ByVal sender AsSystem.Object, ByVal e As System.EventArgs) Handles Button4.Click
ListBox1.Items.Add(ListBox2.SelectedItem)
EndSub
EndClass




 

EJERCICIO EN CLASE

CLASE 23 DE MAYO
EJERCICIO EN CLASE
PublicClassForm1

PrivateSub ListBox1_SelectedIndexChanged (By Val sender AsSystem. Object, ByVal e As System.EventArgs) Handles ListBox1.SelectedIndexChanged

EndSub

PrivateSub Button1_Click(By Val sender AsSystem. Object, ByVal e As System.EventArgs) Handles Button1.Click

listbox1.Items.Add (TextBox1.Text)

EndSub

PrivateSub Button2_Click (ByVal sender AsSystem. Object, ByVal e As System.EventArgs) Handles Button2.Click
ListBox1.Items.RemoveAt (ListBox1.SelectedIndex)






EJERCICO MAKING PARALLS

lunes, 16 de mayo de 2011

BASE DE DATOS



DEMOSTRACIÓN

es un programa del computador que sirve para almacenar datos de una forma organizada
  • para almacenar información, archivos utilizamos base de datos

TIPOS DE BASE DE DATOS
  • ACCES
  • MY SQL
  • DRACLE
  • SQL SERVER
  • INFORMIX
  • SY BASE






EJERCICIO EN CLASE













jueves, 28 de abril de 2011

AJERCICIOS EN CLASE CON LA VARIABLE CASE

PublicClassForm1


PrivateSub Button1_Click(ByVal sender AsSystem.Object, ByVal e AsSystem.EventArgs) Handles Button1.Click
DimgraficoAsGraphics
DimlapizAsPen
grafico = CreateGraphics()
lapiz = NewPen(Color.Blue, 8)
grafico.DrawRectangle(lapiz, 10, 10, 110, 110)

EndSub
EndClass

























PublicClassForm1

PrivateSub Button1_Click(ByVal sender AsSystem.Object, ByVal e AsSystem.EventArgs) Handles Button1.Click
DimfiguraAsString
DimgraficoAsGraphics
Dim lapiz1 AsPen
Dim lapiz2 AsPen
Dim lapiz3 AsPen
grafico = CreateGraphics()
        lapiz1 = NewPen(Color.Blue, 4)
        lapiz2 = NewPen(Color.Red, 3)
        lapiz3 = NewPen(Color.Green, 5)

If RadioButton1.Checked Then
figura = "circulo"

ElseIf RadioButton2.Checked Then
figura = "cuadrado"
Else
figura = "linea"
EndIf


SelectCasefigura
Case"circulo"
grafico.DrawEllipse(lapiz1, 10, 10, 100, 100)

Case"cuadrado"
grafico.DrawRectangle(lapiz2, 10, 10, 100, 100)


Case ("linea")
grafico.DrawLine(lapiz3, 10, 10, 100, 100)
EndSelect

EndSub
EndClass








miércoles, 13 de abril de 2011

VARIABLE FOR i= too=



PrivateSub Button1_Click_1(ByVal sender AsSystem.Object, ByVal e AsSystem.EventArgs) Handles Button1.Click
Dim HOLA As String
HOLA = TextBox1.Text
For i = 1 To 20


            TextBox1.Text += "hola" + vbCrLf
Next i
EndSub
EndClass












PrivateSub Button1_Click_1(ByVal sender AsSystem.Object, ByVal e AsSystem.EventArgs) Handles Button1.Click
Dim HOLA AsString
        HOLA = TextBox1.Text
For i = 1 To 20
            TextBox1.Text += CStr(i) + ".hola" + vbCrLf

Next i
EndSub
EndClass






PrivateSub Button1_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim numero AsInteger
Dim resultado AsInteger
numero = TextBox1.Text
For i = 1 To 20
            resultado = numero * i
            TextBox2.Text += CStr(numero) + "*" + CStr(i) + "=" + CStr(resultado) + vbCrLf


Next i
EndSub
EndClass