Beispiel #1
0
 public static SqlConnection PerformConnectionSoprade()
 {
     try
     {
         string cStringSoprade = C.GetConnectionString("localhost_dbDatosNomina_ConnectionNube");
         if (Connection_BDSoprade == null)
         {
             //Connection_BDSoprade = new SqlConnection("Data Source=db-server\\inarisql;Initial Catalog=dbDatosNomina;User ID=sa;Password=Sql1N4r1;");
             //Connection_BDSoprade = new SqlConnection("Data Source=192.168.4.142;Initial Catalog=dbDatosNomina;User ID=sa;Password=Sql1N4r1;");
             Connection_BDSoprade = new SqlConnection(cStringSoprade);
         }
         return(Connection_BDSoprade);
     }
     catch (Exception e)
     {
         MessageBox.Show(e.Message, "Error");
         return(null);
     }
 }
Beispiel #2
0
 public static SqlConnection PerformConnection()
 {
     try
     {
         //string cString = C.GetFirstConnectionString("localhost_BSNOMINAS_Connection 1");
         string cString = C.GetFirstConnectionString("Asimilados");
         if (Connection_BD == null)
         {
             //Connection_BD = new SqlConnection("Data Source=server-contpaq\\compac17;Initial Catalog=Nomina_Empresa17;User ID=sa;Password=Supervisor2020.;");
             //Connection_BD = new SqlConnection("Data Source=server-contpaq\\compac17;Initial Catalog=BSNOMINAS;User ID=sa;Password=Supervisor2020.;");
             //Connection_BD = new SqlConnection("Data Source=192.168.4.182\\COMPAC;Initial Catalog=BSNOMINAS;User ID=sa;Password=Supervisor2020.;");
             Connection_BD = new SqlConnection(cString);
         }
         return(Connection_BD);
     }
     catch (Exception e)
     {
         MessageBox.Show(e.Message, "Error");
         return(null);
     }
 }