Ejemplo n.º 1
0
 private DAL(String serverName, String DBName)
 {
     if (DBName != null || DBName == "")
     {
         instanceDC = new DBFilmDataContext();
     }
     else
     {
         String connectionstring = "Data Source = " + serverName + " ; Initial Catalog =" + DBName + "; Integrated Security = True";
         instanceDC = new DBFilmDataContext(connectionstring);
     }
     if (!instanceDC.DatabaseExists())  // Vérifier si la DB existe
     {
         instanceDC.CreateDatabase();   // Si elle n'existe pas, on la crée
     }
 }