EntrepotBase.cs 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. using System.Configuration;
  5. using System.Data;
  6. using System.Data.SqlClient;
  7. using CG67.FicheCollege.Domaine;
  8. namespace CG67.FicheCollege.Entrepot
  9. {
  10. public class EntrepotBase
  11. {
  12. protected string ChaineDeConnexion;
  13. protected string ChaineDeConnexionCollege;
  14. protected string ChaineDeConnexionSubvention;
  15. // protected string ChaineDeConnexionAccess;
  16. public EntrepotBase()
  17. {
  18. this.ChaineDeConnexion = ConfigurationManager.AppSettings["ConnexionStringSic"];
  19. if (string.IsNullOrEmpty(this.ChaineDeConnexion))
  20. {
  21. throw new Exception("Chaine de connexion Sql Server non renseignée");
  22. }
  23. this.ChaineDeConnexionCollege = ConfigurationManager.AppSettings["ConnexionStringOracleCollege"];
  24. if (string.IsNullOrEmpty(this.ChaineDeConnexionCollege))
  25. {
  26. throw new Exception("Chaine de connexion Oracle non renseignée");
  27. }
  28. this.ChaineDeConnexionSubvention = ConfigurationManager.AppSettings["ConnexionStringOracleSubvention"];
  29. if (string.IsNullOrEmpty(this.ChaineDeConnexionSubvention))
  30. {
  31. throw new Exception("Chaine de connexion Oracle non renseignée");
  32. }
  33. //this.ChaineDeConnexionAccess = ConfigurationManager.AppSettings["ConnexionStringAccess"];
  34. //if (string.IsNullOrEmpty(this.ChaineDeConnexionAccess))
  35. //{
  36. // throw new Exception("Chaine de connexion Access non renseignée");
  37. //}
  38. }
  39. }
  40. }