Sysferry

Páginas: 15 (3514 palabras) Publicado: 16 de diciembre de 2012
CODIGOS DE PROYECTOS

Imports System.Data.OleDb
Public Class Datos_Banco

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

Try
Dim sqlguardar As String
sqlguardar = " Insert into Datos_Banco(Nombre_Banco,Fecha_Formacion,Metodologia,Codigo_Promotor,Observacion,Ciclo) " & _"values('" & nombanco.Text & "','" & fformacion.Text & "','" & metodologia.Text & "','" & codprom.Text & "','" & Txtobs.Text & "','" & Txtcbanco.Text & "')"

Dim comando As New OleDbCommand(sqlguardar, princiapal.cnx)

Dim r As Integer
r = comando.ExecuteNonQuery()

MsgBox("registroingresado exitosamente")
Me.Close()

Catch ex As Exception
MessageBox.Show(ex.Message, "Ocurrio el siguiente error")

End Try

End Sub

Private Sub codprom_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles codprom.KeyPress
REM If Isnumeric(asc(e.keychar))then e.Handled=true
If(Asc(e.KeyChar)) >= 48 And (Asc(e.KeyChar)) <= 57 Or (Asc(e.KeyChar)) = System.Windows.Forms.Keys.Back Then
e.Handled = False
Else
e.Handled = True
End If

End Sub

Private Sub fformacion_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles fformacion.KeyPress
e.Handled = True

End SubPrivate Sub metodologia_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles metodologia.KeyPress
e.Handled = True
End Sub

Private Sub Txtcbanco_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles Txtcbanco.KeyPress
REM if isnumeric(asc(e.keychar))then e.handled=true
If(Asc(e.KeyChar)) >= 48 And (Asc(e.KeyChar)) <= 57 Or (Asc(e.KeyChar)) = System.Windows.Forms.Keys.Back Then
e.Handled = False
Else
e.Handled = True
End If
End Sub



Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Me.Close()

End Sub
End Class

ImportsSystem.Data.OleDb

Public Class Datos_del_Promotor

Private Sub Guardar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Guardar.Click
Try

Dim guardar As String

guardar = "insert into Promotor(Nombre,codigo_promotor,Sector)" & _
"values('" & nomprom.Text & "','" & Idprom.Text & "','" &Sector.Text & "')"

Dim comando As New OleDbCommand(guardar, princiapal.cnx)

Dim t As Integer
t = comando.ExecuteNonQuery
MsgBox("Registro ingresado correctamente")
Me.Close()

Catch ex As Exception
MessageBox.Show(ex.Message, "ocurrio el siguiente error")
End Try
End Sub
End ClassImports System.Data.OleDb
Public Class Desembolso

Dim tabla1 As New DataTable
Private Sub Desembolso_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

Dim comando1 As New OleDbCommand("select nombre_banco from Datos_banco order by nombre_banco", princiapal.cnx)

Dim tabla1 As OleDbDataReader

tabla1 =comando1.ExecuteReader()

While tabla1.Read()

cbbanco.Items.Add(tabla1("nombre_banco"))

End While
tabla1.Close()

Try

Dim dt As New DataTable
Dim ds As New DataSet
ds.Tables.Add(dt)
Dim da As New OleDbDataAdapter("select Nombre_Socio from Datos_Socio where Nombre_banco ='" & cbbanco.Text & "' ",...
Leer documento completo

Regístrate para leer el documento completo.

Conviértase en miembro formal de Buenas Tareas

INSCRÍBETE - ES GRATIS