<%@ Page Language="C#" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.OleDb" %>
<script runat="server">
void Page_Load(Object Sender, EventArgs e) {
OleDbConnection objConn = new OleDbConnection(
"PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=" +
Server.MapPath("EmployeeDatabase.mdb;"));
OleDbCommand objCmd = new OleDbCommand("select * from employee", objConn);
OleDbDataReader objReader;
objConn.Open();
objReader = objCmd.ExecuteReader();
while (objReader.Read()) {
Response.Write(objReader.GetInt32(0) + "<br>");
}
objConn.Close();
}
</script>
<html><body>
</body></html>
|