Visual Basic.NET - Ayuda explicar codigo porfavor

   
Vista:

Ayuda explicar codigo porfavor

Publicado por Mario Alberto (1 intervención) el 15/06/2015 01:25:57
Hola , pido su ayuda mañana tengo un examen y tengo que explicar linea por linea este codigo me podrain ayudar a explicarlo por favor...

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
Imports System.Data.OleDb
Imports System.Data.SqlClient
 
 
Public Class Form2
 
 
 
 
    Private Sub TextBox1_TextChanged(sender As Object, e As EventArgs) Handles TextBox1.TextChanged
 
        Try
            sql = "Buscar_Docente'" + TextBox1.Text + "'"
            conectar()
            com = New SqlClient.SqlCommand(sql, conexion)
            da = New SqlClient.SqlDataAdapter(sql, conexion)
            cb = New SqlClient.SqlCommandBuilder(da)
            ds = New DataSet
            dr = com.ExecuteReader
            If dr.Read Then
                da.Fill(ds, "Insertar_Docente")
                DataGridView1.DataSource = ds.Tables(0)
            End If
            dr.Close()
 
 
        Catch ex As Exception
        End Try
    End Sub
 
 
 
    Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
        Try
            'Guardar
 
 
 
            sql = "Insertar_Registro'" + ComboBox1.Text + "','" + ComboBox2.Text + "','" + TextBox2.Text + "','" + TextBox3.Text + "','" + TextBox4.Text + "','" + TextBox5.Text + "','" + TextBox6.Text + "','" + TextBox7.Text + "'"
            conectar()
 
            com = New SqlClient.SqlCommand(sql, conexion)
            res = com.ExecuteNonQuery
            dr.Close()
 
 
            sql = "Select Identificacion, Tipo_Visita, Numero_Control,IdDocente, IdGuadia ,Nombre,Apellido_Paterno,Apellido_Materno,HoraEntrada,HoraSalida from Registro "
            conectar()
            com = New SqlClient.SqlCommand(sql, conexion)
            da = New SqlClient.SqlDataAdapter(sql, conexion)
            cb = New SqlClient.SqlCommandBuilder(da)
            ds = New DataSet
            dr = com.ExecuteReader
            If dr.Read() Then
                da.Fill(ds, "registros")
                DataGridView2.DataSource = ds.Tables(0)
            End If
 
 
            dr.Close()
 
            MsgBox("Registro Exitoso")
        Catch ex As Exception
            MsgBox("El Docente Especificado No Existe")
        End Try
    End Sub
 
 
 
    Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click
 
    End Sub
 
 
 
 
    Private Sub TextBox8_TextChanged(sender As Object, e As EventArgs) Handles TextBox8.TextChanged
        Try
            sql = "Buscar_Alumno'" + TextBox8.Text + "'"
            conectar()
            com = New SqlClient.SqlCommand(sql, conexion)
            da = New SqlClient.SqlDataAdapter(sql, conexion)
            cb = New SqlClient.SqlCommandBuilder(da)
            ds = New DataSet
            dr = com.ExecuteReader
            If dr.Read Then
                da.Fill(ds, "Agregar_Alumno")
                DataGridView3.DataSource = ds.Tables(0)
            End If
            dr.Close()
 
 
        Catch ex As Exception
        End Try
    End Sub
 
    Private Sub TextBox9_TextChanged(sender As Object, e As EventArgs) Handles TextBox9.TextChanged
        Try
            sql = "Buscar_Visitante'" + TextBox9.Text + "'"
            conectar()
            com = New SqlClient.SqlCommand(sql, conexion)
            da = New SqlClient.SqlDataAdapter(sql, conexion)
            cb = New SqlClient.SqlCommandBuilder(da)
            ds = New DataSet
            dr = com.ExecuteReader
            If dr.Read Then
                da.Fill(ds, "Insertar_Visitante")
                DataGridView4.DataSource = ds.Tables(0)
            End If
            dr.Close()
 
 
        Catch ex As Exception
        End Try
    End Sub
 
 
    Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
        Try
 
            sql = "Actualizar_guardia'" + TextBox10.Text + "','" + TextBox11.Text + "','" + TextBox12.Text + "','" + TextBox13.Text + "','" + TextBox14.Text + "'"
 
            conectar()
            com = New SqlClient.SqlCommand(sql, conexion)
            da = New SqlClient.SqlDataAdapter(sql, conexion)
            cb = New SqlClient.SqlCommandBuilder(da)
            ds = New DataSet
            dr = com.ExecuteReader
            If dr.Read Then
                da.Fill(ds, "Insertar_Guardia")
                DataGridView5.DataSource = ds.Tables(0)
            End If
 
            dr.Close()
            MsgBox("Actualizacion Exitosa")
        Catch ex As Exception
            MsgBox("Solo Puede Ingresar Numeros A La Nueva Contraseña")
        End Try
    End Sub
 
    Private Sub Form2_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        sql = "ver_Identificacion "
        conectar()
        com = New SqlClient.SqlCommand(sql, conexion)
        da = New SqlClient.SqlDataAdapter(sql, conexion)
        cb = New SqlClient.SqlCommandBuilder(da)
        ds = New DataSet
        dr = com.ExecuteReader
        While dr.Read
            ComboBox1.Items.Add(dr(0))
        End While
 
        dr.Close()
 
        sql = "ver_Tipo_Visita "
        conectar()
        com = New SqlClient.SqlCommand(sql, conexion)
        da = New SqlClient.SqlDataAdapter(sql, conexion)
        cb = New SqlClient.SqlCommandBuilder(da)
        ds = New DataSet
        dr = com.ExecuteReader
        While dr.Read
            ComboBox2.Items.Add(dr(0))
        End While
 
        dr.Close()
 
        Dim id As String
        id = Form1.TextBox1.Text
 
        sql = "ver_Guardia'" + id + "'"
 
        conectar()
        com = New SqlClient.SqlCommand(sql, conexion)
        da = New SqlClient.SqlDataAdapter(sql, conexion)
        cb = New SqlClient.SqlCommandBuilder(da)
        ds = New DataSet
        dr = com.ExecuteReader
        'Si encuentra el id lo muestra en pantalla'
        If dr.Read Then
            TextBox10.Text = dr(0)
            TextBox4.Text = dr(0)
            dr.Close()
            conexion.Close()
        Else
 
        End If
 
 
    End Sub
 
    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        End
    End Sub
 
    Private Sub Button5_Click(sender As Object, e As EventArgs) Handles Button5.Click
        End
    End Sub
 
 
 
    Private Sub TabPage2_Click(sender As Object, e As EventArgs) Handles TabPage2.Click
 
    End Sub
 
 
    Private Sub Button7_Click(sender As Object, e As EventArgs) Handles Button7.Click
        Try
            sql = "Hora_salida_A'" + TextBox8.Text + "'"
            conectar()
            com = New SqlClient.SqlCommand(sql, conexion)
            da = New SqlClient.SqlDataAdapter(sql, conexion)
            cb = New SqlClient.SqlCommandBuilder(da)
            ds = New DataSet
            dr = com.ExecuteReader
            If dr.Read Then
                da.Fill(ds, "Inserta_Alumno_Salida")
                DataGridView3.DataSource = ds.Tables(0)
            End If
            dr.Close()
            MsgBox("Registro de Hora salida")
        Catch ex As Exception
            MsgBox("Especifique Un Registro  Existente")
        End Try
    End Sub
 
    Private Sub Button8_Click(sender As Object, e As EventArgs) Handles Button8.Click
        Try
            sql = "Hora_salida_V'" + TextBox9.Text + "'"
            conectar()
            com = New SqlClient.SqlCommand(sql, conexion)
            da = New SqlClient.SqlDataAdapter(sql, conexion)
            cb = New SqlClient.SqlCommandBuilder(da)
            ds = New DataSet
            dr = com.ExecuteReader
            If dr.Read Then
                da.Fill(ds, "Insertar_Visitante")
                DataGridView4.DataSource = ds.Tables(0)
            End If
            dr.Close()
            MsgBox("Registro de Hora salida")
        Catch ex As Exception
            MsgBox("Especifique Un visitante Existente")
        End Try
    End Sub
 
    Private Sub ComboBox1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox1.SelectedIndexChanged
 
    End Sub
 
    Private Sub DataGridView5_CellContentClick(sender As Object, e As DataGridViewCellEventArgs) Handles DataGridView5.CellContentClick
 
    End Sub
 
    Private Sub Button9_Click(sender As Object, e As EventArgs) Handles Button9.Click
        Dim id As String
        id = Form1.TextBox1.Text
 
        sql = "Insertar_Guardia '" + id + "'"
        conectar()
        com = New SqlClient.SqlCommand(sql, conexion)
        da = New SqlClient.SqlDataAdapter(sql, conexion)
        cb = New SqlClient.SqlCommandBuilder(da)
        ds = New DataSet
        dr = com.ExecuteReader
        If dr.Read Then
            da.Fill(ds, "Insertar_Guardia")
            DataGridView5.DataSource = ds.Tables(0)
        End If
 
        dr.Close()
    End Sub
 
 
 
    Private Sub Button10_Click(sender As Object, e As EventArgs) Handles Button10.Click
        Me.Hide()
        Form6.Show()
    End Sub
 
    Private Sub Button6_Click(sender As Object, e As EventArgs) Handles Button6.Click
        Me.Hide()
        Form1.Show()
    End Sub
End Class
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

Ayuda explicar codigo porfavor

Publicado por omar pcc.nett.2018@hotmail.com (151 intervenciones) el 15/06/2015 20:28:28
Y cuanto pagaras para que se te explique este codigo
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
-1
Comentar

Ayuda explicar codigo porfavor

Publicado por Horroroso (46 intervenciones) el 22/06/2015 19:04:08
Que es lo que no entiendes? porque darte una explicacion 285 lineas, linea por linea esta dificil.. mejor di que linea no entiendes.
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar