Exemple #1
0
        private void searchExemplaire_Click(object sender, EventArgs e)
        {
            try
            {
                DataSet
                    oData = new DataSet();

                ServiceReferenceExemplaires.ServiceExemplairesClient se = new ServiceReferenceExemplaires.ServiceExemplairesClient();



                oData = se.GetAll();


                string search = "code like '%" + textBoxCode.Text + "%'";

                var dt = oData.Tables[0].DefaultView;

                dt.RowFilter = search;



                gridData.DataSource                   = dt;
                gridData.Columns["id1"].Visible       = false;
                gridData.Columns["Code1"].Visible     = false;
                gridData.Columns["id_biblio"].Visible = false;
                gridData.Columns["idLivre"].Visible   = false;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Exemple #2
0
        private void buttonDataset_Click(object sender, EventArgs e)
        {
            ServiceReferenceExemplaires.ServiceExemplairesClient se = new ServiceReferenceExemplaires.ServiceExemplairesClient();
            DataSet oData = new DataSet();

            oData = se.GetAll();
            gridData.DataSource                   = oData.Tables[0].DefaultView;
            gridData.Columns["id1"].Visible       = false;
            gridData.Columns["code1"].Visible     = false;
            gridData.Columns["id_biblio"].Visible = false;
            gridData.Columns["idLivre"].Visible   = false;
            if (gridData != null)
            {
                gridData.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells;
                gridData.Columns[gridData.ColumnCount - 1].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
            }
        }