FGHJKL
-
Upload
darlin-chavez -
Category
Documents
-
view
2 -
download
0
description
Transcript of FGHJKL
![Page 1: FGHJKL](https://reader036.fdocuments.us/reader036/viewer/2022082822/5695d2201a28ab9b02993110/html5/thumbnails/1.jpg)
Imports System.Data.SqlClientImports System.Data.SqlPublic Class CONEXION Public CN As SqlConnection Public CMD As SqlCommand Sub New() Try CN = New SqlConnection("Data Source=PC02;Initial Catalog=SISBD;Integrated Security=True") CN.Open() MsgBox("CONECTADO") Catch ex As Exception MsgBox("NO ESTOY CONECTADO A LA BD" + ex.ToString) End Try End Sub Function INSERTAPERSONA(ByVal CODIGO As String, ByVal NOMBRE As String, ByVal APELLIDO As String, ByVal TELEFONO As String, ByVal EDAD As String) Dim SALIDA As String = " LOS ELEMENTOS SE INSERTARON CORRECTAMENTE" Try CMD = New SqlCommand("INSERTAPERSONA", CN) CMD.CommandType = CommandType.StoredProcedure With CMD.Parameters .AddWithValue("@CODIGO", CODIGO) .AddWithValue("@NOMBRE", NOMBRE) .AddWithValue("@APELLIDO", APELLIDO) .AddWithValue("@TELEFONO", TELEFONO) .AddWithValue("@EDAD", EDAD) End With Catch ex As Exception Return SALIDA
End Try End FunctionEnd Class
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End SubEnd Class