private void frm_cotisation_real_Load(object sender, EventArgs e)
        {
            rd_nomPrenom.Checked  = true;
            pnl_nomPrenom.Visible = true;
            ///
            ////////////
            txt_chercher = MyHint.LoadText(txt_chercher, "Nom ou Prenom");
            //////////

            ds.Tables.Clear();
            if (cn.State != ConnectionState.Open)
            {
                cn.ConnectionString = ConfigurationManager.ConnectionStrings["SyndicCS"].ToString();
                cn.Open();
            }
            da = new SqlDataAdapter("Select id_cotisation as [NumCotisation],date_cotisation as Date,montant as Montant,concat(nom,' ',prenom) as Proprietaire,nomType as Type from cotisation c join proprietaire p on p.id_proprietaire = c.id_proprietaire  join type_cotisation t on t.id_type = c.id_typeCotisation  where c.archive = 1", cn);
            if (!ds.Tables.Contains("cotisation"))
            {
                da.Fill(ds, "cotisation");
            }



            bsProp.DataSource = ds;
            bsProp.DataMember = "cotisation";

            dataGridView1.DataSource = bsProp;
        }
        private void frm_Echeance_Load(object sender, EventArgs e)
        {
            txt_search      = MyHint.LoadText(txt_search, "Nom de bien");
            rd_tous.Checked = true;

            //Fonctions.ouvrireConnection();
            cn = Fonctions.CnConnection();
            if (cn.State != ConnectionState.Open)
            {
                cn.Open();
            }

            ////les annee

            ////les Mois
            WhoChecked = "";

            sqlQuery = "Select id_echeance,mois,annee,montant,montant_recu,NomApparetemnt from echeance e inner join Bien b on b.id_bien = e.id_bien join immeuble i on i.id_immeuble = b.id_immeuble where e.archive = 1 and paiment like '%" + WhoChecked + "%' ";

            com    = new SqlCommand(sqlQuery, Fonctions.CnConnection());
            reader = com.ExecuteReader();

            dataGridView1.ColumnCount     = 6;
            dataGridView1.Columns[0].Name = "Id";
            dataGridView1.Columns[1].Name = "Mois";
            dataGridView1.Columns[2].Name = "Anne";
            dataGridView1.Columns[3].Name = "Montant";
            dataGridView1.Columns[4].Name = "Montant Recu";
            dataGridView1.Columns[5].Name = "Bien";
            /////////////////////////////////
            // com = new SqlCommand("Select montant from Bien",cn);
            //readerMontant = com.ExecuteReader();
            //while (readerMontant.Read())
            //{

            //}



            while (reader.Read())
            {
                dataGridView1.Rows.Add(reader[0].ToString(), reader[1].ToString(), reader[2].ToString(), reader[3].ToString(), reader[4].ToString(), reader[5].ToString());
            }
            ////////// //////// ///////// /////////// ////////////// ////////////// ///////////

            reader.Close();
        }