Exemplo n.º 1
0
        private void btnSearch_Click(object sender, EventArgs e)
        {
            // Get Data
            Person temp = new Person();
            // Perform the search we created in Person class and store the returned dataset
            DataSet ds = temp.SearchContacts(txtFirstName.Text, txtLastName.Text);

            // Display data (dataset)
            gvResults.DataSource = ds;                              // point datagrid to dataset
            gvResults.DataMember = ds.Tables["Persons"].ToString(); // What table in the dataset
            // gvResults.DataMember = ds.Tables[0].TableName;       // Alt. Method to display table without knowing the name
        }