ADO Net Database ASP.Net Tutorial

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

   'declare connection
   dim Conn as new OleDbConnection( _
            "PROVIDER=Microsoft.Jet.OLEDB.4.0;" _
            & "DATA SOURCE=" _
            & Server.MapPath("EmployeeDatabase.mdb;"))
   sub Submit(Sender as Object, e as EventArgs)
      dim objCmd as OleDbCommand = new OleDbCommand("SelectIDFromName", Conn)
      dim objReader as OleDbDataReader
      objCmd.CommandType = CommandType.StoredProcedure
      dim objParam as OleDbParameter
      objParam = objCmd.Parameters.Add("@FirstName", OleDbType.Char)
      objParam.Direction = ParameterDirection.Input
      objParam.Value = tbFirst.Text
      objParam = objCmd.Parameters.Add("@LastName",OleDbType.Char)
      objParam.Direction = ParameterDirection.Input
      objParam.Value = tbLast.Text
      try
         objCmd.Connection.Open()
         objReader = objCmd.ExecuteReader
      catch ex as OleDbException
         Response.Write("Error retrieving data.")
      end try
      DataGrid1.DataSource = objReader
      DataGrid1.DataBind()
      objCmd.Connection.Close()
   End Sub
   


   
      Enter a first name:
      

      Enter a last name:
      
               Text="Submit"
         OnClick="Submit"/>
               AutoGenerateColumns="true" />