Primero importar la clase Imports System.Data.OleDb Despues agregar un Datagrid en el formulario, con el nombre de Grid. Seguidamente pegar este código:
Dim strSelect As New String("Select * from fotos")
Dim con As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=C:\Inetpub\wwwroot\csUpImatges\fotos.mdb")
Dim com As New OleDbCommand(strSelect, con)
con.Open()
Me.Grid.DataSource = com.ExecuteReader()
Me.Grid.DataBind()
con.Close()
Deberéis de modificar la sentencia SQL y la cadena de conexión.
Los trucos ASP.NET más vistos
Este truco ha recibido 19 votaciones| Nota media: 6Selecciona tu
Puntuación: