Ing. Sistemas
Enviado por antonyiza • 1 de Diciembre de 2012 • 333 Palabras (2 Páginas) • 259 Visitas
Public Sub re ()
N=0
Open “Origen 1.DAT” For Input As #1
Do
Do
Input #1, r
Loop Until r = c O r EOF (1)
If r = c Then
N = n + 1
Input #1, q (n)
Input #1, e (n)
0 = 0
Do
Input #1, s
If s <> c Then
Input #1, t
0 = 0 + 1
m (n, 0) = s
f(n, 0) = Val(t)
End If
Loop Until s = c
End If
Loop Until EOF (1)
Close #1
End Sub
Imports System.Data.SqlClient
Public Class frmProfesion
Private Sub cmdInsertar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdInsertar.Click
Dim cmd As New SqlCommand
Dim con As SqlConnection
Dim str As String
Try
str = "Data source =.\sqlexpress; initial catalog=matricula;integrated security= true"
con = New SqlConnection(str)
cmd = New SqlCommand
cmd.CommandText = "insert profesion values(" & txtcodigo.text & ",'" & txtnombre.text & "')"
cmd.Connection = con
cmd.CommandType = CommandType.Text
con.Open()
cmd.ExecuteNonQuery()
con.Close()
txtcodigo.text = ""
txtnombre.text = ""
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.Critical, "boton insertar frminsert")
End Try
End Sub
...