Set Connection to Access database (VB.net) : Access « ADO.net Database « ASP.NET Tutorial






<%@ Page Language="VB" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.OleDB" %>

<script runat="server">
   sub Page_Load(Sender as Object, e as EventArgs) 
      dim myConnection as new OleDbConnection( _
            "PROVIDER=Microsoft.Jet.OLEDB.4.0;" _
            & "DATA SOURCE=" & Server.MapPath("EmployeeDatabase.mdb;"))

      dim myCommand as OleDbDataAdapter = new OleDbDataAdapter("select * from employee", myConnection)
       dim ds as DataSet = new DataSet()
       myCommand.Fill(ds, "employee")
    end sub
</script>

<html><body>
   <form runat="server">
   
   </form>
</body></html>








18.38.Access
18.38.1.Set Connection to Access database (VB.net)
18.38.2.Execute an insert statement on Access database
18.38.3.Read scalar data from Access database
18.38.4.Execute select statement against Access database
18.38.5.Execute an update statement against Access database
18.38.6.Iterating Through A DataSet for Access database