コード例 #1
0
        public void CloseConnection()
        {
            try
            {
                _oLogErrors = new LogErrores();
                _oConnection.Close();

            }
            catch (Exception ex)
            {
                _oLogErrors.GuardarLog(IConstantes.TIPOCAPA.ACCESODATOS, this.GetType().ToString(), MethodInfo.GetCurrentMethod().Name, ex.Message);
            }
        }
コード例 #2
0
        public ProyectoZDA(string user, string password, string server, string port, string database = "master")
        {
            try
            {
                _oLogErrors = new LogErrores();
                //string conexionBD = ConfigurationManager.AppSettings["CargoDispatcherDB"];

                ConnectionString = "Data Source=" + server + "," + port + ";Network Library=DBMSSOCN;Initial Catalog=" + database + ";User ID=" + user + ";Password="******";Integrated Security = SSPI;";

            }
            catch (Exception ex)
            {
                _oLogErrors.GuardarLog(IConstantes.TIPOCAPA.ACCESODATOS, this.GetType().ToString(), MethodInfo.GetCurrentMethod().Name, ex.Message);
            }
        }
コード例 #3
0
        public MysqlServerDA(string user, string password, string server, string port, string database="test")
        {
            try
            {
                _oLogErrors = new LogErrores();
                //string conexionBD = ConfigurationManager.AppSettings["CargoDispatcherDB"];

                ConnectionString = "server=" + server + ";user="******";database=" + database + ";port=" + port + ";password="******";";

            }
            catch (Exception ex)
            {
                _oLogErrors.GuardarLog(IConstantes.TIPOCAPA.ACCESODATOS, this.GetType().ToString(), MethodInfo.GetCurrentMethod().Name, ex.Message);
            }
        }
コード例 #4
0
        /// <summary>
        /// This is the Base Class for all the DA Method's Inside This Library
        /// Date: 9/4/2014
        /// Created By: Juan Pablo Arias Mora
        /// </summary>
        public SqlServerDA()
        {
            try
            {
                _oLogErrors = new LogErrores();
                //string conexionBD = ConfigurationManager.AppSettings["CargoDispatcherDB"];

                ConnectionString = "user id=ReplicationManager_su;" +
                                   "password=12345;server=localhost;" +
                                   "Trusted_Connection=yes;" +
                                   "database=ReplicationManager; " +
                                   "connection timeout=30";

                //_oConnection = new MySqlConnection(conexionBD);

            }
            catch (Exception ex)
            {
                _oLogErrors.GuardarLog(IConstantes.TIPOCAPA.ACCESODATOS, this.GetType().ToString(), MethodInfo.GetCurrentMethod().Name, ex.Message);
            }
        }
コード例 #5
0
 private void LogViewer_Load(object sender, EventArgs e)
 {
     LogErrores tempLogErrores = new LogErrores();
     string path = tempLogErrores.LogLocation();
     rtbLog.LoadFile(path, RichTextBoxStreamType.PlainText);
 }
コード例 #6
0
        /// <summary>
        /// This method will Open the Connection Required.
        /// Date: 9/4/2014
        /// Created By: Juan Pablo Arias Mora     
        /// </summary>
        public void OpenConnection()
        {
            try
            {
                _oLogErrors = new LogErrores();
                _oConnection = new SqlConnection(this.ConnectionString);
                _oConnection.Open();
                //_oConnection = new MySqlConnection(ConfigurationManager.AppSettings["CargoDispatcherDB"]);

            }
            catch (Exception ex)
            {
                _oLogErrors.GuardarLog(IConstantes.TIPOCAPA.ACCESODATOS, this.GetType().ToString(), MethodInfo.GetCurrentMethod().Name, ex.Message);
            }
        }