Acceso A Datos Ado

  • November 2019
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Acceso A Datos Ado as PDF for free.

More details

  • Words: 126
  • Pages: 2
Acceso a datos ADO.NET Cadena de conexión con autenticación de Windows Data Source = ServidorSQL; Initial Catalog = BaseDatos; Integrated Security = True

Cadena de conexión con autenticación de SQL Server data source = ServidorSQL; initial catalog = BaseDatos; user id = Usuario; password = Contraseña

Conectar usando un objeto SqlDataAdapter Imports System.Data Imports System.Data.SqlClient

Dim sCnn As String sCnn = "data source = ServidorSQL; initial catalog = BaseDatos; user id = Usuario; password = Contraseña"

Dim sSel As String = "SELECT * FROM NombreTabla" Dim da As SqlDataAdapter Dim dt As New DataTable Try da = New SqlDataAdapter(sSel, sCnn) da.Fill(dt) Me.GridView1.DataSource = dt Me.GridView1.DataBind() LabelInfo.Text = String.Format("Total datos en la tabla: {0}", dt.Rows.Count) Catch ex As Exception LabelInfo.Text = "Error: " & ex.Message End Try

Related Documents

Acceso A Datos Ado
November 2019 10
Datos Acceso
November 2019 13
Ado
November 2019 63
Acceso A La Justicia
April 2020 18
Ado
November 2019 61