You are on page 1of 1

///general

Imports System.Data
Imports System.Data.SqlClient
Imports System.Net
Imports System.IO
///boton altas
Dim connection As New SqlConnection("data source=ACER01\SQLEXPRESS;initial cat
alog=pruebabd;integrated security=true")
Dim comando As New SqlCommand("storedprocedure1", connection)
comando.CommandType = CommandType.StoredProcedure
comando.Parameters.Add("@no_control", SqlDbType.Int).Value = TextBox1.Te
xt.Trim
comando.Parameters.Add("@nombre", SqlDbType.Char, 50).Value = UCase(Text
Box2.Text.Trim)
comando.Parameters.Add("@apellidopaterno", SqlDbType.Char, 50).Value = U
Case(TextBox3.Text.Trim)
comando.Parameters.Add("@apellidomaterno", SqlDbType.Char, 50).Value = U
Case(TextBox4.Text.Trim)
comando.Parameters.Add("@correo_electronico", SqlDbType.Char, 50).Value
= TextBox5.Text.Trim
comando.Parameters.Add("@direccion", SqlDbType.Char, 50).Value = UCase(T
extBox6.Text.Trim)
comando.Parameters.Add("@telefono", SqlDbType.Int).Value = UCase(TextBox
7.Text.Trim)
Try
connection.Open()
comando.ExecuteNonQuery()
If connection.State = ConnectionState.Open Then
connection.Close()
End If
'mensaje("documento agregado con exito")
'gridview2.databind()
Catch ex As Exception
'mensaje(ex.Message)
connection.Close()
End Try

You might also like