public List <ReferentielBLL> ObtenirListeReferentiel_SQLITE()
        {
            Console.WriteLine("ici");
            using (ConnexionSQLITE con = new ConnexionSQLITE())
            {
                Dictionary <string, string> columnNameToAddColumnSql = new Dictionary <string, string>
                {
                    {
                        "FlagPreventiel",
                        "ALTER TABLE TB$S_PrevReferentiel ADD COLUMN FlagPreventiel INTEGER "
                    }
                };

                foreach (var pair in columnNameToAddColumnSql)
                {
                    string columnName = pair.Key;
                    string sql        = pair.Value;

                    try
                    {
                        con.ExecuteQuery(sql);
                        con.ExecuteQuery("Update TB$S_PrevReferentiel set FlagPreventiel = 0");
                    }
                    catch (System.Data.SQLite.SQLiteException e)
                    {
                        con.sql_con.Close();
                        Console.WriteLine(string.Format("Failed to create column [{0}]. Most likely it already exists, which is fine.", columnName));
                    }
                }


                List <ReferentielBLL> ListRef = new List <ReferentielBLL>();

                con.sql_con.Open();
                string CommandText = "select * from TB$S_PREVReferentiel";
                using (con.sql_cmd = new SQLiteCommand(CommandText, con.sql_con))
                {
                    using (SQLiteDataReader reader = con.sql_cmd.ExecuteReader())
                    {
                        Fonc fonc = new Fonc();
                        while (reader.Read())
                        {
                            ReferentielBLL Ref = new ReferentielBLL();
                            if (reader["Type"] != DBNull.Value)
                            {
                                Ref.Type = (string)reader["Type"];
                            }
                            if (reader["TypeItem"] != DBNull.Value)
                            {
                                Ref.TypeItem = (string)reader["TypeItem"];
                            }
                            if (reader["Code"] != DBNull.Value)
                            {
                                Ref.Code = (string)reader["Code"];
                            }
                            if (reader["Lib"] != DBNull.Value && (string)reader["Lib"] != "")
                            {
                                Ref.Lib       = (string)reader["Lib"];
                                Ref.Canonical = fonc.CanonicalString((string)reader["Lib"]);
                            }
                            if (reader["CodeOrigine"] != DBNull.Value)
                            {
                                Ref.CodeOrigine = (string)reader["CodeOrigine"];
                            }
                            if (reader["InActif"] != DBNull.Value)
                            {
                                Ref.InActif = Convert.ToBoolean(reader["InActif"]);
                            }
                            //Console.WriteLine(reader["InActif"]);
                            //Ref.InActif = Convert.ToBoolean(Convert.ToString(reader["InActif"]));
                            if (reader["Cpl"] != DBNull.Value && (string)reader["Cpl"] != "")
                            {
                                Ref.Cpl = (string)reader["Cpl"];
                            }
                            else
                            {
                                Ref.Cpl = "0";
                            }
                            if (reader["Cpl1"] != DBNull.Value && (string)reader["Cpl1"] != "")
                            {
                                Ref.Cpl1 = (string)reader["Cpl1"];
                            }
                            else
                            {
                                Ref.Cpl1 = "0";
                            }
                            if (reader["Cpl2"] != DBNull.Value && (string)reader["Cpl2"] != "")
                            {
                                Ref.Cpl2 = (string)reader["Cpl2"];
                            }
                            else
                            {
                                Ref.Cpl2 = "0";
                            }
                            if (reader["Cpl3"] != DBNull.Value && (string)reader["Cpl3"] != "")
                            {
                                Ref.Cpl3 = (string)reader["Cpl3"];
                            }
                            else
                            {
                                Ref.Cpl3 = "0";
                            }
                            if (reader["DateFinValidite"] != DBNull.Value)
                            {
                                Ref.DateFinValidite = (string)reader["DateFinValidite"];
                            }
                            if (reader["FlagPreventiel"] != DBNull.Value)
                            {
                                Ref.FlagPreventiel = Convert.ToInt32(reader["FlagPreventiel"]);
                            }
                            ListRef.Add(Ref);
                        }
                        con.sql_con.Close();
                        con.sql_con.Dispose();
                    }
                }



                //sql_cmd = sql_con.CreateCommand();
                //string CommandText = "select Type_Item, Ancien_Code, Libelle_Ancien_Code,AncienCodeActif,Nouveau_Code,Libelle_Nouveau_Code,Code_utilise,NomSchema,DateRecensement,DateMAJ,TypeRecodage,NouveauCodeInactif,UtilisateurCreation,TypeRef,NomRef,Cpl,Cpl1,Cpl2,Occurrence from TB$S_CorrespondanceItem";
                // where TypeItem !='PersonnePhysique'";
                //string CommandText = "select Type,TypeItem,Code,Lib,CodeOrigine,InActif,Cpl,Cpl1,Cpl2,Cpl3,DateFinValidite from TB$S_PREVReferentiel where (Type!='CTRL' and Cpl!='0') ";


                //DB = new SQLiteDataAdapter(CommandText, sql_con);

                return(ListRef);
            }
        }