0% found this document useful (0 votes)
25 views

Sqlconnection Sqlcommand Commandtype Sqldataadapter Datatable

The document contains code for connecting to a SQL database and executing stored procedures and queries. It defines connection strings and objects for a SQL connection, command, data adapter, and data reader. Stored procedures are called to retrieve data from tables and update user information in the database. The results are loaded into a data table and bound to a datagrid for display.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views

Sqlconnection Sqlcommand Commandtype Sqldataadapter Datatable

The document contains code for connecting to a SQL database and executing stored procedures and queries. It defines connection strings and objects for a SQL connection, command, data adapter, and data reader. Stored procedures are called to retrieve data from tables and update user information in the database. The results are loaded into a data table and bound to a datagrid for display.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

SELECT soc.nombres, soc.apellidos, soc.direccion, soc.celular, soc.edad, pro.codsocioe, pro.empresa, pro.representante FROM dbo.tproyectos AS pro INNER JOIN dbo.

tsocios AS soc ON soc.codsocio = pro.codsocioe WHERE (soc.codsocio >= 2)

set ANSI_NULLS ON set QUOTED_IDENTIFIER ON GO ALTER procedure [dbo].[spmodificausuario] @codigo int, @nombres varchar(20), @clave varchar(15), @estado varchar(15), @codempresau varchar(10) as update tusuarios set nombresusu=@nombres,claveusu=@clave,estadousu=@estado,codempresau=@codemp resau where codusu=@codigo return

con = New SqlConnection(conexion) con.Open() cmd = New SqlCommand("spusuarios", con) cmd.CommandType = CommandType.StoredProcedure cmd.ExecuteNonQuery() Dim oda As New SqlDataAdapter(cmd) Dim dt As New DataTable() oda.Fill(dt) Me.DataGridView1.DataSource = dt

Dim con As New SqlConnection Dim conexion As String = "Data Source=ASNUVI\SQLEXPRESS;Initial Catalog=bdasnuvi;User ID=sa;Password=12345"

Dim cmd Private Private Private Private Private Private

As New SqlCommand oda As SqlDataAdapter ods As DataSet iposfilaactual As Integer dr As DataRow dr1 As DataRow drd As SqlDataReader

You might also like