<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.OleDb" %>
<script language="VB" runat="server">
sub Page_Load(Sender as Object, e as EventArgs)
dim objConn as new OleDbConnection( _
"PROVIDER=Microsoft.Jet.OLEDB.4.0;" _
& "DATA SOURCE=" _
& Server.MapPath("EmployeeDatabase.mdb;"))
dim objCmd as OleDbDataAdapter = new OleDbDataAdapter("select * from employee", objConn)
dim ds as DataSet = new DataSet()
objCmd.Fill(ds, "employee")
MyDataList.DataSource = ds.Tables("employee").DefaultView
MyDataList.DataBind()
end sub
</script>
<html><body>
<ASP:DataList id="MyDataList" RepeatColumns="2"
RepeatDirection="Vertical" runat="server">
<ItemTemplate>
<div style="padding:15,15,15,15;font-size:10pt;
font-family:Verdana">
<div style="font:12pt verdana;color:darkred">
<i><b><%# DataBinder.Eval(Container.DataItem, "FirstName")%>
<%# DataBinder.Eval(Container.DataItem, "LastName")%>
</i></b>
</div>
<br>
<b>ID: </b><%# DataBinder.Eval(Container.DataItem, _
"ID") %><br>
</div>
</ItemTemplate>
</ASP:DataList>
</body></html>
|