ADO Database ASP.Net

<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.OleDb" %>

void Page_Load()
{
  string strConnection = "Provider=Microsoft.Jet.OleDb.4.0;";
  strConnection += @"Data Source="+MapPath("EmployeeDatabase.mdb");
  data_src.Text = strConnection;
  string strSQL = "SELECT FirstName,LastName FROM Employee";
  string strResultsHolder = "";
  OleDbConnection objConnection = new OleDbConnection(strConnection);
  OleDbCommand objCommand = new OleDbCommand(strSQL, objConnection);
  OleDbDataReader objDataReader = null;
  try {
    objConnection.Open();
    con_open.Text="Connection opened successfully.
";
    objDataReader = objCommand.ExecuteReader();
    while (objDataReader.Read() == true)
    {
       strResultsHolder += objDataReader["FirstName"];
       strResultsHolder += " ";
       strResultsHolder += objDataReader["LastName"];
       strResultsHolder += "
";
    }
    objDataReader.Close();
    objConnection.Close();
    con_close.Text = "
Connection closed.
";
    divListEmployees.InnerHtml = strResultsHolder;
  }
  catch (Exception e)
  {
    con_open.Text = "Connection failed to open successfully.
";
    con_close.Text = e.ToString();
  }
}


  
  

Reading data from the connection
   with the DataReader object.


  

  list will go here

  

  

           
       
EmployeeDatabase.zip( 10 k)