Exemplo n.º 1
0
    protected void btnAdd_Click(object sender, EventArgs e)
    {
        //instantiate new clsDataLayer object.
        clsDataLayer myDataLayer = new clsDataLayer();

        //string to hold location of database.
        string TempPath = Server.MapPath("App_Data/AddressBook.mdb");

        //call the method in clsDataLayer Object and pass in arguments from the text boxes on the form.
        myDataLayer.InsertAddress(TempPath, txtFirstName.Text, txtLastName.Text, txtPhoneNumber.Text, txtEmail.Text);

        //bind the grid view with the newly added information.
        BindGridView();
    }