<%@ Page Title="Data" MasterPageFile="Site.master" %>
<%@ Import Namespace="System.IO" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.OleDb" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="Server">
<h1>Customers</h1>
<%
Dim dbconn As OleDbConnection
Dim objAdapter As OleDbDataAdapter
Dim objTable As DataTable
Dim objRow As DataRow
Dim objDataSet As New DataSet()
dbconn=New OledbConnection("Provider=Microsoft.Jet.OLEDB.4.0;data source=C:\WebData\Northwind.mdb")
objAdapter=New OledbDataAdapter("SELECT * FROM customers",dbconn)
objAdapter.Fill(objDataSet,"myTable")
objTable=objDataSet.Tables("myTable")
response.write("<table border='1'>")
response.write("<tr><th>Name</th><th>City</th><th>Country</th></tr>")
for each x in objTable.Rows
response.write("<tr>")
response.write("<td>" & x("companyname") & "</td>")
response.write("<td>" & x("city") & "</td>")
response.write("<td>" & x("country") & "</td>")
response.write("</tr>")
next
response.write("</table>")
dbconn.Close()
%>
</asp:Content>