STEPS
1) Create New ASP.Net Web Site in the path c:\projects\Campaign.
2) Download a sample mdb file, e.g http://www.arialsoftware.com/uploads/9/1/8/3/9183466/campaign_template1.zip ,unzip and save the file to c:\projects\Campaign\App_Data.
3) Add New Web Form, Default.aspx
4) Edit as follows:
<%@ Page Language="VB" %>
<%@ Import Namespace="System.Data.OleDb" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
dim dbconn,sql,dbcomm,dbread
dbconn = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;data source=" & Server.MapPath("App_Data/Campaign_Template.mdb"))
dbconn.Open()
sql = "SELECT * FROM Campaign_Table"
dbcomm = New OleDbCommand(sql, dbconn)
dbread = dbcomm.ExecuteReader()
customers.DataSource = dbread
customers.DataBind()
dbread.Close()
dbconn.Close()
End Sub
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="Form1" runat="server">
<asp:Repeater id="customers" runat="server">
<HeaderTemplate>
<table border="1" width="100%">
<tr>
<th>ID</th>
<th>Last_Name</th>
<th>First_Name</th>
<th>Email_Address</th>
</tr>
</HeaderTemplate>
<ItemTemplate>
<tr>
<td><%#Container.DataItem("ID")%></td>
<td><%#Container.DataItem("Last_Name")%></td>
<td><%#Container.DataItem("First_Name")%></td>
<td><%#Container.DataItem("Email_Address")%></td>
</tr>
</ItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:Repeater>
</form>
</body>
</html>
|
5) Run.